mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-05 14:51:01 +01:00
37 lines
837 B
PHP
37 lines
837 B
PHP
<?php
|
|
|
|
namespace Tests\Feature\Console;
|
|
|
|
use App\Console\Commands\CheckDbConnection;
|
|
use Illuminate\Support\Facades\DB;
|
|
use PHPUnit\Framework\Attributes\CoversClass;
|
|
use Tests\FeatureTestCase;
|
|
|
|
/**
|
|
* CheckDbConnectionTest test class
|
|
*/
|
|
#[CoversClass(CheckDbConnection::class)]
|
|
class CheckDbConnectionTest extends FeatureTestCase
|
|
{
|
|
/**
|
|
* @test
|
|
*/
|
|
public function test_CheckDbConnection_ends_successfully()
|
|
{
|
|
$this->artisan('2fauth:check-db-connection')
|
|
->assertExitCode(1);
|
|
}
|
|
|
|
/**
|
|
* @test
|
|
*/
|
|
// public function test_CheckDbConnection_without_db_returns_false()
|
|
// {
|
|
// DB::shouldReceive('connection', 'getPDO')
|
|
// ->andThrow(new \Exception());
|
|
|
|
// $this->artisan('2fauth:check-db-connection')
|
|
// ->assertExitCode(0);
|
|
// }
|
|
}
|