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'));
 }