1 <?php namespace Tests\Commands;
3 use BookStack\Actions\Comment;
6 class RegenerateCommentContentCommandTest extends TestCase
8 public function test_regenerate_comment_content_command()
10 Comment::query()->forceCreate([
11 'html' => 'some_old_content',
12 'text' => 'some_fresh_content',
15 $this->assertDatabaseHas('comments', [
16 'html' => 'some_old_content',
19 $exitCode = \Artisan::call('bookstack:regenerate-comment-content');
20 $this->assertTrue($exitCode === 0, 'Command executed successfully');
22 $this->assertDatabaseMissing('comments', [
23 'html' => 'some_old_content',
25 $this->assertDatabaseHas('comments', [
26 'html' => "<p>some_fresh_content</p>\n",