Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Nov 13, 2024
1 parent 09c12eb commit f6780f3
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Console/Commands/ClearMedia.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ public function handle(): void
$count++;
});

$this->info(sprintf('%d media are cleared!', $count));
$this->info(sprintf('%d media have been deleted!', $count));
}
}
2 changes: 1 addition & 1 deletion tests/Console/ActionMakeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function test_action_make_command(): void
$this->artisan('root:action', ['name' => 'TestAction'])
->assertExitCode(Command::SUCCESS);

$this->assertFileExists($this->app->path('/Root/Actions/TestAction.php'));
$this->assertFileExists($this->app->path('Root/Actions/TestAction.php'));
}

public function tearDown(): void
Expand Down
21 changes: 21 additions & 0 deletions tests/Console/ClearMediaTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Cone\Root\Tests\Console;

use Cone\Root\Models\Medium;
use Cone\Root\Tests\TestCase;
use Illuminate\Console\Command;

class ClearMediaTest extends TestCase
{
public function test_clear_media_command(): void
{
$medium = Medium::factory()->create();

$this->artisan('root:clear-media')
->expectsOutput('1 media have been deleted!')
->assertExitCode(Command::SUCCESS);

$this->assertDatabaseMissing('root_media', ['id' => $medium->getKey()]);
}
}
2 changes: 1 addition & 1 deletion tests/Console/FieldMakeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function test_field_make_command(): void
])
->assertExitCode(Command::SUCCESS);

$this->assertFileExists($this->app->path('/Root/Fields/TestField.php'));
$this->assertFileExists($this->app->path('Root/Fields/TestField.php'));
}

public function tearDown(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/Console/FilterMakeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function test_filter_make_command(): void
])
->assertExitCode(Command::SUCCESS);

$this->assertFileExists($this->app->path('/Root/Filters/TestFilter.php'));
$this->assertFileExists($this->app->path('Root/Filters/TestFilter.php'));
}

public function tearDown(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/Console/ResourceMakeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function test_resource_make_command(): void
$this->artisan('root:resource', ['name' => 'TestResource'])
->assertExitCode(Command::SUCCESS);

$this->assertFileExists($this->app->path('/Root/Resources/TestResource.php'));
$this->assertFileExists($this->app->path('Root/Resources/TestResource.php'));
}

public function tearDown(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/Console/TrendMakeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function test_trend_make_command(): void
$this->artisan('root:trend', ['name' => 'TrendWidget'])
->assertExitCode(Command::SUCCESS);

$this->assertFileExists($this->app->path('/Root/Widgets/TrendWidget.php'));
$this->assertFileExists($this->app->path('Root/Widgets/TrendWidget.php'));
}

public function tearDown(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/Console/ValueMakeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function test_value_make_command(): void
$this->artisan('root:value', ['name' => 'ValueWidget'])
->assertExitCode(Command::SUCCESS);

$this->assertFileExists($this->app->path('/Root/Widgets/ValueWidget.php'));
$this->assertFileExists($this->app->path('Root/Widgets/ValueWidget.php'));
}

public function tearDown(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/Console/WidgetMakeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function test_widget_make_command(): void
$this->artisan('root:widget', ['name' => 'TestWidget'])
->assertExitCode(Command::SUCCESS);

$this->assertFileExists($this->app->path('/Root/Widgets/TestWidget.php'));
$this->assertFileExists($this->app->path('Root/Widgets/TestWidget.php'));
}

public function tearDown(): void
Expand Down

0 comments on commit f6780f3

Please sign in to comment.