File tree Expand file tree Collapse file tree 9 files changed +29
-8
lines changed
Expand file tree Collapse file tree 9 files changed +29
-8
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,6 @@ public function handle(): void
3434 $ count ++;
3535 });
3636
37- $ this ->info (sprintf ('%d media are cleared ! ' , $ count ));
37+ $ this ->info (sprintf ('%d media have been deleted ! ' , $ count ));
3838 }
3939}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public function test_action_make_command(): void
1313 $ this ->artisan ('root:action ' , ['name ' => 'TestAction ' ])
1414 ->assertExitCode (Command::SUCCESS );
1515
16- $ this ->assertFileExists ($ this ->app ->path ('/ Root/Actions/TestAction.php ' ));
16+ $ this ->assertFileExists ($ this ->app ->path ('Root/Actions/TestAction.php ' ));
1717 }
1818
1919 public function tearDown (): void
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Cone \Root \Tests \Console ;
4+
5+ use Cone \Root \Models \Medium ;
6+ use Cone \Root \Tests \TestCase ;
7+ use Illuminate \Console \Command ;
8+
9+ class ClearMediaTest extends TestCase
10+ {
11+ public function test_clear_media_command (): void
12+ {
13+ $ medium = Medium::factory ()->create ();
14+
15+ $ this ->artisan ('root:clear-media ' )
16+ ->expectsOutput ('1 media have been deleted! ' )
17+ ->assertExitCode (Command::SUCCESS );
18+
19+ $ this ->assertDatabaseMissing ('root_media ' , ['id ' => $ medium ->getKey ()]);
20+ }
21+ }
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ public function test_field_make_command(): void
1616 ])
1717 ->assertExitCode (Command::SUCCESS );
1818
19- $ this ->assertFileExists ($ this ->app ->path ('/ Root/Fields/TestField.php ' ));
19+ $ this ->assertFileExists ($ this ->app ->path ('Root/Fields/TestField.php ' ));
2020 }
2121
2222 public function tearDown (): void
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public function test_filter_make_command(): void
1717 ])
1818 ->assertExitCode (Command::SUCCESS );
1919
20- $ this ->assertFileExists ($ this ->app ->path ('/ Root/Filters/TestFilter.php ' ));
20+ $ this ->assertFileExists ($ this ->app ->path ('Root/Filters/TestFilter.php ' ));
2121 }
2222
2323 public function tearDown (): void
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public function test_resource_make_command(): void
1313 $ this ->artisan ('root:resource ' , ['name ' => 'TestResource ' ])
1414 ->assertExitCode (Command::SUCCESS );
1515
16- $ this ->assertFileExists ($ this ->app ->path ('/ Root/Resources/TestResource.php ' ));
16+ $ this ->assertFileExists ($ this ->app ->path ('Root/Resources/TestResource.php ' ));
1717 }
1818
1919 public function tearDown (): void
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public function test_trend_make_command(): void
1313 $ this ->artisan ('root:trend ' , ['name ' => 'TrendWidget ' ])
1414 ->assertExitCode (Command::SUCCESS );
1515
16- $ this ->assertFileExists ($ this ->app ->path ('/ Root/Widgets/TrendWidget.php ' ));
16+ $ this ->assertFileExists ($ this ->app ->path ('Root/Widgets/TrendWidget.php ' ));
1717 }
1818
1919 public function tearDown (): void
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public function test_value_make_command(): void
1313 $ this ->artisan ('root:value ' , ['name ' => 'ValueWidget ' ])
1414 ->assertExitCode (Command::SUCCESS );
1515
16- $ this ->assertFileExists ($ this ->app ->path ('/ Root/Widgets/ValueWidget.php ' ));
16+ $ this ->assertFileExists ($ this ->app ->path ('Root/Widgets/ValueWidget.php ' ));
1717 }
1818
1919 public function tearDown (): void
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public function test_widget_make_command(): void
1313 $ this ->artisan ('root:widget ' , ['name ' => 'TestWidget ' ])
1414 ->assertExitCode (Command::SUCCESS );
1515
16- $ this ->assertFileExists ($ this ->app ->path ('/ Root/Widgets/TestWidget.php ' ));
16+ $ this ->assertFileExists ($ this ->app ->path ('Root/Widgets/TestWidget.php ' ));
1717 }
1818
1919 public function tearDown (): void
You can’t perform that action at this time.
0 commit comments