mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
Use single connection MySQL driver in test env
This commit is contained in:
parent
d344745e7d
commit
3fc192bc11
3 changed files with 21 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ matrix:
|
|||
- php: 5.5
|
||||
|
||||
before_script:
|
||||
- "ulimit -n 10000"
|
||||
- "sudo apt-get install -y wkhtmltopdf"
|
||||
- "export DISPLAY=:99.0"
|
||||
- "sh -e /etc/init.d/xvfb start"
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ swiftmailer:
|
|||
doctrine:
|
||||
dbal:
|
||||
dbname: %sylius.database.name%_test
|
||||
driver_class: Sylius\Bundle\CoreBundle\Tests\MySqlDriver
|
||||
|
||||
sylius_money:
|
||||
currency: EUR
|
||||
|
|
|
|||
19
src/Sylius/Bundle/CoreBundle/Tests/MySqlDriver.php
Normal file
19
src/Sylius/Bundle/CoreBundle/Tests/MySqlDriver.php
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace Sylius\Bundle\CoreBundle\Tests;
|
||||
|
||||
use Doctrine\DBAL\Driver\PDOMySql\Driver;
|
||||
|
||||
class MySqlDriver extends Driver
|
||||
{
|
||||
private static $connection;
|
||||
|
||||
public function connect(array $params, $username = null, $password = null, array $driverOptions = array())
|
||||
{
|
||||
if (null === self::$connection) {
|
||||
self::$connection = parent::connect($params, $username, $password, $driverOptions);
|
||||
}
|
||||
|
||||
return self::$connection;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue