-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#4295 Restored master, slaves, keepReplica params in MasterSlaveConne…
…ction
- Loading branch information
Joe Bennett
committed
Sep 27, 2020
1 parent
1687865
commit f0b9b39
Showing
2 changed files
with
43 additions
and
3 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
43 changes: 43 additions & 0 deletions
43
tests/Doctrine/Tests/DBAL/Connections/MasterSlaveConnectionTest.php
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,43 @@ | ||
<?php | ||
|
||
namespace Doctrine\Tests\DBAL\Connections; | ||
|
||
use Doctrine\DBAL\Connections\MasterSlaveConnection; | ||
use Doctrine\DBAL\Driver; | ||
use Doctrine\Tests\DbalTestCase; | ||
|
||
class MasterSlaveConnectionTest extends DbalTestCase | ||
{ | ||
/** | ||
* \Doctrine\DBAL\Connection::getParams has been marked @internal as of 2.11.0 | ||
* This test will be removed in 3.0 | ||
*/ | ||
public function testConnectionDoesParamsRemainAvailable(): void | ||
{ | ||
$constructionParams = [ | ||
'driver' => 'pdo_mysql', | ||
'keepSlave' => true, | ||
'master' => [ | ||
'host' => 'master.host', | ||
'user' => 'root', | ||
'password' => 'password', | ||
'port' => '1234', | ||
], | ||
'slaves' => [ | ||
[ | ||
'host' => 'slave1.host', | ||
'user' => 'root', | ||
'password' => 'password', | ||
'port' => '1234', | ||
], | ||
], | ||
]; | ||
|
||
$connection = new MasterSlaveConnection($constructionParams, $this->createMock(Driver::class)); | ||
|
||
$connectionParams = $connection->getParams(); | ||
foreach ($constructionParams as $key => $value) { | ||
self::assertSame($constructionParams[$key], $value); | ||
} | ||
} | ||
} |