/** * @test */ public function settings() { $file = __DIR__ . '/local.xml'; $settings = new DbSettings($file); $this->assertSame('', $settings->getTablePrefix()); $this->assertSame('localhost', $settings->getHost()); $this->assertNull($settings->getPort()); $this->assertNull($settings->getUnixSocket()); $this->assertSame('user', $settings->getUsername()); $this->assertSame('pass', $settings->getPassword()); // DbSettings is more strict here, only using known DSN settings, see @link http://php.net/ref.pdo-mysql.connection // minus those settings that are black-listed: dbname, charset // "mysql:host=localhost;initStatements=SET NAMES utf8;model=mysql4;type=pdo_mysql;pdoType=;active=1;prefix=" $this->assertEquals('mysql:host=localhost', $settings->getDsn()); }