-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ^4.0 to composer and test all cases #18. The following changes have been made so that all dbal versions can be supported: * Choose database platform based on name or instance depending on method existence. * Move logging for tests to wrapper class, as DebugStack was removed in 4.0 and middlewares have only existed since 3.2.
- Loading branch information
Showing
13 changed files
with
155 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Marein\LockDoctrineMigrationsBundle\Tests\Integration; | ||
|
||
use Doctrine\DBAL\Cache\QueryCacheProfile; | ||
use Doctrine\DBAL\Connection; | ||
use Throwable; | ||
|
||
final class Dbal2Connection extends Connection | ||
{ | ||
public array $loggedQueries = []; | ||
|
||
public function connect() | ||
{ | ||
try { | ||
parent::connect(); | ||
} catch (Throwable $e) { | ||
sleep(1); | ||
$this->connect(); | ||
} | ||
} | ||
|
||
public function executeQuery($sql, array $params = [], $types = [], ?QueryCacheProfile $qcp = null) | ||
{ | ||
$this->loggedQueries[] = [ | ||
'sql' => $sql, | ||
'params' => $params | ||
]; | ||
|
||
return parent::executeQuery($sql, $params, $types, $qcp); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Marein\LockDoctrineMigrationsBundle\Tests\Integration; | ||
|
||
use Doctrine\DBAL\Cache\QueryCacheProfile; | ||
use Doctrine\DBAL\Connection; | ||
use Doctrine\DBAL\Result; | ||
use Throwable; | ||
|
||
final class Dbal3Connection extends Connection | ||
{ | ||
public array $loggedQueries = []; | ||
|
||
public function connect() | ||
{ | ||
try { | ||
parent::connect(); | ||
} catch (Throwable $e) { | ||
sleep(1); | ||
$this->connect(); | ||
} | ||
} | ||
|
||
public function executeQuery(string $sql, array $params = [], $types = [], ?QueryCacheProfile $qcp = null): Result | ||
{ | ||
$this->loggedQueries[] = [ | ||
'sql' => $sql, | ||
'params' => $params | ||
]; | ||
|
||
return parent::executeQuery($sql, $params, $types, $qcp); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Marein\LockDoctrineMigrationsBundle\Tests\Integration; | ||
|
||
use Doctrine\DBAL\Cache\QueryCacheProfile; | ||
use Doctrine\DBAL\Connection; | ||
use Doctrine\DBAL\Driver\Connection as DriverConnection; | ||
use Doctrine\DBAL\Result; | ||
use Throwable; | ||
|
||
final class Dbal4Connection extends Connection | ||
{ | ||
public array $loggedQueries = []; | ||
|
||
public function connect(): DriverConnection | ||
{ | ||
try { | ||
return parent::connect(); | ||
} catch (Throwable $e) { | ||
sleep(1); | ||
return $this->connect(); | ||
} | ||
} | ||
|
||
public function executeQuery(string $sql, array $params = [], $types = [], ?QueryCacheProfile $qcp = null): Result | ||
{ | ||
$this->loggedQueries[] = [ | ||
'sql' => $sql, | ||
'params' => $params | ||
]; | ||
|
||
return parent::executeQuery($sql, $params, $types, $qcp); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters