database() публичный Метод

Access a project database
public database ( string $dbname ) : Db
$dbname string
Результат Pop\Db\Db
Пример #1
0
 public function testDatabase()
 {
     $p = new Project(new Config(array('databases' => array('testdb' => Db::factory('Sqlite', array('database' => __DIR__ . '/../tmp/test.sqlite'))), 'defaultDb' => 'testdb')), array('Test' => new Config(array('some' => 'thing'))), new Router(array('Pop\\Mvc\\Controller' => new Controller())));
     $this->assertInstanceOf('Pop\\Db\\Db', $p->database('testdb'));
     $this->assertNull($p->database('baddb'));
 }