3 namespace Tests\Commands;
5 use BookStack\Actions\Comment;
8 class RegenerateCommentContentCommandTest extends TestCase
10 public function test_regenerate_comment_content_command()
12 Comment::query()->forceCreate([
13 'html' => 'some_old_content',
14 'text' => 'some_fresh_content',
17 $this->assertDatabaseHas('comments', [
18 'html' => 'some_old_content',
21 $exitCode = \Artisan::call('bookstack:regenerate-comment-content');
22 $this->assertTrue($exitCode === 0, 'Command executed successfully');
24 $this->assertDatabaseMissing('comments', [
25 'html' => 'some_old_content',
27 $this->assertDatabaseHas('comments', [
28 'html' => "<p>some_fresh_content</p>\n",