Opened #4821 to remove the DB field in a few releases time.
/**
* @property int $id
- * @property string $text
+ * @property string $text - Deprecated & now unused (#4821)
* @property string $html
* @property int|null $parent_id - Relates to local_id, not id
* @property int $local_id
use HasFactory;
use HasCreatorAndUpdater;
- protected $fillable = ['text', 'parent_id'];
+ protected $fillable = ['parent_id'];
protected $appends = ['created', 'updated'];
/**
return [
'html' => $html,
- 'text' => $text,
'parent_id' => null,
'local_id' => 1,
];
$resp = $this->postJson("/comment/$page->id", $comment->getAttributes());
$resp->assertStatus(200);
- $resp->assertSee($comment->text);
+ $resp->assertSee($comment->html, false);
$pageResp = $this->get($page->getUrl());
- $pageResp->assertSee($comment->text);
+ $pageResp->assertSee($comment->html, false);
$this->assertDatabaseHas('comments', [
'local_id' => 1,
private function addComment(Page $page): TestResponse
{
- $comment = Comment::factory()->make();
-
- return $this->postJson("/comment/$page->id", $comment->only('text', 'html'));
+ return $this->postJson("/comment/$page->id", ['html' => '<p>New comment content</p>']);
}
private function updateComment(Comment $comment): TestResponse
{
- $commentData = Comment::factory()->make();
-
- return $this->putJson("/comment/{$comment->id}", $commentData->only('text', 'html'));
+ return $this->putJson("/comment/{$comment->id}", ['html' => '<p>Updated comment content</p>']);
}
private function deleteComment(Comment $comment): TestResponse