mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 22:46:16 +00:00
#591 - tests
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
use App\Facades\SSH;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ServicesTest extends TestCase
|
||||
@ -57,9 +58,7 @@ public function test_show_service(): void
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*/
|
||||
#[DataProvider('data')]
|
||||
public function test_manage_service(string $action): void
|
||||
{
|
||||
Sanctum::actingAs($this->user, ['read', 'write']);
|
||||
@ -94,6 +93,10 @@ public function test_uninstall_service(): void
|
||||
]))
|
||||
->assertSuccessful()
|
||||
->assertNoContent();
|
||||
|
||||
$this->assertDatabaseMissing('services', [
|
||||
'id' => $service->id,
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_cannot_uninstall_service_because_it_is_being_used(): void
|
||||
@ -112,6 +115,9 @@ public function test_cannot_uninstall_service_because_it_is_being_used(): void
|
||||
->assertJsonValidationErrorFor('service');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<array<string>>
|
||||
*/
|
||||
public static function data(): array
|
||||
{
|
||||
return [
|
||||
|
Reference in New Issue
Block a user