@tsteur opened this Pull Request on July 4th 2018 Member

Otherwise it would create a connection just to destroy it. Noticed this when my tests were failing because of this.

Failed to setup fixture: TEST INITIALIZATION FAILED: SQLSTATE[HY000] [1049] Unknown database 'piwik_tests'
<a href='/0'>#0</a> libs/Zend/Db/Adapter/Pdo/Mysql.php(109): Zend_Db_Adapter_Pdo_Abstract->_connect()
<a href='/1'>#1</a> core/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Mysql->_connect()
<a href='/2'>#2</a> core/Db/Adapter/Pdo/Mysql.php(74): Piwik\Db\Adapter\Pdo\Mysql->_connect()
<a href='/3'>#3</a> core/Db/Adapter.php(51): Piwik\Db\Adapter\Pdo\Mysql->getConnection()
<a href='/4'>#4</a> core/Db.php(122): Piwik\Db\Adapter::factory('PDO\\MYSQL', Array)
<a href='/5'>#5</a> core/Db.php(54): Piwik\Db::createDatabaseObject()
<a href='/6'>#6</a> core/DbHelper.php(142): Piwik\Db::get()
<a href='/7'>#7</a> core/Db.php(144): Piwik\DbHelper::disconnectDatabase()
<a href='/8'>#8</a> tests/PHPUnit/Framework/Fixture.php(869): Piwik\Db::destroyDatabaseObject()
<a href='/9'>#9</a> tests/PHPUnit/Framework/Fixture.php(227): Piwik\Tests\Framework\Fixture::connectWithoutDatabase()
<a href='/10'>#10</a> tests/PHPUnit/Framework/TestCase/SystemTestCase.php(76): Piwik\Tests\Framework\Fixture->performSetUp()
<a href='/11'>#11</a> tests/PHPUnit/Framework/TestCase/IntegrationTestCase.php(61): Piwik\Tests\Framework\TestCase\SystemTestCase::setUpBeforeClass()
This Pull Request was closed on July 8th 2018
Powered by GitHub Issue Mirror