2FAuth/tests/Feature/Console/CheckDbConnectionTest.php
2023-09-26 08:40:36 +02:00

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);
// }
}