Use single connection MySQL driver in test env

This commit is contained in:
Paweł Jędrzejewski 2013-08-17 23:10:22 +02:00
parent d344745e7d
commit 3fc192bc11
3 changed files with 21 additions and 0 deletions

View file

@ -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"

View file

@ -17,6 +17,7 @@ swiftmailer:
doctrine:
dbal:
dbname: %sylius.database.name%_test
driver_class: Sylius\Bundle\CoreBundle\Tests\MySqlDriver
sylius_money:
currency: EUR

View 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;
}
}