Skip to content

Commit f6780f3

Browse files
committed
wip
1 parent 09c12eb commit f6780f3

File tree

9 files changed

+29
-8
lines changed

9 files changed

+29
-8
lines changed

src/Console/Commands/ClearMedia.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

tests/Console/ActionMakeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

tests/Console/ClearMediaTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
}

tests/Console/FieldMakeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

tests/Console/FilterMakeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

tests/Console/ResourceMakeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

tests/Console/TrendMakeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

tests/Console/ValueMakeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

tests/Console/WidgetMakeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)