mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-06 06:15:51 -05:00
Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
This commit is contained in:
co-authored by
Anthony
Sky Mulley
parent
98079a0166
commit
6c0413e39b
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Pterodactyl\Tests\Support\Fakes;
|
||||
|
||||
use Pterodactyl\Extensions\DynamicDatabaseConnection;
|
||||
use Pterodactyl\Models\DatabaseHost;
|
||||
use Throwable;
|
||||
|
||||
class FakeDynamicDatabaseConnection extends DynamicDatabaseConnection
|
||||
{
|
||||
public ?Throwable $throwOnSet = null;
|
||||
|
||||
/** @var list<array{connection: string, host: DatabaseHost|int, database: string}> */
|
||||
public array $setCalls = [];
|
||||
|
||||
public function __construct() {}
|
||||
|
||||
public function set(string $connection, DatabaseHost|int $host, string $database = 'mysql'): void
|
||||
{
|
||||
$this->setCalls[] = [
|
||||
'connection' => $connection,
|
||||
'host' => $host,
|
||||
'database' => $database,
|
||||
];
|
||||
|
||||
if ($this->throwOnSet !== null) {
|
||||
throw $this->throwOnSet;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user