mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-01 20:54:03 +01:00
34 lines
845 B
PHP
34 lines
845 B
PHP
<?php
|
|
|
|
namespace Tests\Feature\Console;
|
|
|
|
use App\Console\Commands\CheckDbConnection;
|
|
use Illuminate\Support\Facades\DB;
|
|
use PHPUnit\Framework\Attributes\CoversClass;
|
|
use PHPUnit\Framework\Attributes\Test;
|
|
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);
|
|
// }
|
|
}
|