mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 15:23:12 +08:00
Updated to doctrine-migrations 3.3
This commit is contained in:
@@ -67,7 +67,7 @@ class CreateDatabaseCommand extends AbstractDatabaseCommand
|
||||
|
||||
// In order to create the new database, we have to use a connection where the dbname was not set.
|
||||
// Otherwise, it will fail to connect and will not be able to create the new database
|
||||
$schemaManager = $this->noDbNameConn->getSchemaManager();
|
||||
$schemaManager = $this->noDbNameConn->createSchemaManager();
|
||||
$databases = $schemaManager->listDatabases();
|
||||
$shlinkDatabase = $this->regularConn->getDatabase();
|
||||
|
||||
@@ -80,7 +80,7 @@ class CreateDatabaseCommand extends AbstractDatabaseCommand
|
||||
{
|
||||
// If at least one of the shlink tables exist, we will consider the database exists somehow.
|
||||
// Any inconsistency should be taken care by the migrations
|
||||
$schemaManager = $this->regularConn->getSchemaManager();
|
||||
$schemaManager = $this->regularConn->createSchemaManager();
|
||||
return ! empty($schemaManager->listTableNames());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,10 +46,10 @@ class CreateDatabaseCommandTest extends TestCase
|
||||
$this->databasePlatform = $this->prophesize(AbstractPlatform::class);
|
||||
|
||||
$this->regularConn = $this->prophesize(Connection::class);
|
||||
$this->regularConn->getSchemaManager()->willReturn($this->schemaManager->reveal());
|
||||
$this->regularConn->createSchemaManager()->willReturn($this->schemaManager->reveal());
|
||||
$this->regularConn->getDatabasePlatform()->willReturn($this->databasePlatform->reveal());
|
||||
$noDbNameConn = $this->prophesize(Connection::class);
|
||||
$noDbNameConn->getSchemaManager()->willReturn($this->schemaManager->reveal());
|
||||
$noDbNameConn->createSchemaManager()->willReturn($this->schemaManager->reveal());
|
||||
|
||||
$command = new CreateDatabaseCommand(
|
||||
$locker->reveal(),
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace ShlinkioTest\Shlink\Rest\Action;
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||
use Doctrine\DBAL\Result;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Exception;
|
||||
use Laminas\Diactoros\Response\JsonResponse;
|
||||
@@ -27,8 +28,7 @@ class HealthActionTest extends TestCase
|
||||
public function setUp(): void
|
||||
{
|
||||
$this->conn = $this->prophesize(Connection::class);
|
||||
$this->conn->executeQuery(Argument::cetera())->will(function (): void {
|
||||
});
|
||||
$this->conn->executeQuery(Argument::cetera())->willReturn($this->prophesize(Result::class)->reveal());
|
||||
$dbPlatform = $this->prophesize(AbstractPlatform::class);
|
||||
$dbPlatform->getDummySelectSQL()->willReturn('');
|
||||
$this->conn->getDatabasePlatform()->willReturn($dbPlatform->reveal());
|
||||
|
||||
Reference in New Issue
Block a user