/** * Sets up the connection information and creates a test table. */ public function setUp() { Database::setEngineName('MySQL'); // All these options are found in phpunit.mysql.xml. Database::setEngineOptions(array('host' => $GLOBALS['db_host'], 'user' => $GLOBALS['db_user'], 'pwd' => $GLOBALS['db_pwd'], 'db_name' => $GLOBALS['db_name'])); $this->setUpTestTable(); }
/** * Tests to ensure the connect method returns true when the connection is successful. */ public function testConnectReturn() { Database::setEngineName('Mock'); Database::setEngineOptions(array()); Database::setDriverClassName('\\QueryerTests\\Mocker\\MockDatabaseDriver'); $this->assertTrue(Database::connect()); }