コード例 #1
0
 /**
  * @testdox unit test: Test getDefaultSchema() returns default schema from connection object
  * @covers Zend\Db\Adapter\Adapter::getDefaultSchema
  */
 public function testGetDefaultSchema()
 {
     $this->mockConnection->expects($this->any())->method('getDefaultSchema')->will($this->returnValue('FooSchema'));
     $this->assertEquals('FooSchema', $this->adapter->getDefaultSchema());
 }
コード例 #2
0
 /**
  * Constructor
  * 
  * @param Adapter $adapter 
  */
 public function __construct(Adapter $adapter)
 {
     $this->adapter = $adapter;
     $this->defaultSchema = ($adapter->getDefaultSchema()) ?: '__DEFAULT_SCHEMA__';
 }