/** * TestCase Constructor. * * @return void */ public function setUp() { $this->sub_configuration = $this->getMock('Lunr\\Core\\Configuration'); $this->configuration = $this->getMock('Lunr\\Core\\Configuration'); $map = array(array('path', $this->sub_configuration)); $this->configuration->expects($this->any())->method('offsetGet')->will($this->returnValueMap($map)); $this->request = $this->getMock('Lunr\\Corona\\RequestInterface'); $this->response = $this->getMock('Lunr\\Corona\\Response'); $this->class = $this->getMockBuilder('Lunr\\Corona\\View')->setConstructorArgs(array($this->request, $this->response, $this->configuration))->getMockForAbstractClass(); $this->reflection = new ReflectionClass('Lunr\\Corona\\View'); }
/** * TestCase Constructor. */ public function setUp() { $this->sub_configuration = $this->getMock('Lunr\\Core\\Configuration'); $this->configuration = $this->getMock('Lunr\\Core\\Configuration'); $map = [['db', $this->sub_configuration]]; $this->configuration->expects($this->any())->method('offsetGet')->will($this->returnValueMap($map)); $map = [['rw_host', 'rw_host'], ['username', 'username'], ['password', 'password'], ['database', 'database'], ['driver', 'mysql']]; $this->sub_configuration->expects($this->any())->method('offsetGet')->will($this->returnValueMap($map)); $this->logger = $this->getMock('Psr\\Log\\LoggerInterface'); $this->mysqli = $this->getMock('\\mysqli'); $this->class = new MySQLConnection($this->configuration, $this->logger, $this->mysqli); $this->reflection = new ReflectionClass('Lunr\\Gravity\\Database\\MySQL\\MySQLConnection'); }
/** * TestCase Constructor. */ public function setUp() { if (extension_loaded('sqlite3') === FALSE) { $this->markTestSkipped('Extension sqlite3 is required.'); } $this->sub_configuration = $this->getMock('Lunr\\Core\\Configuration'); $this->configuration = $this->getMock('Lunr\\Core\\Configuration'); $map = array(array('db', $this->sub_configuration)); $this->configuration->expects($this->any())->method('offsetGet')->will($this->returnValueMap($map)); $map = array(array('file', '/tmp/test.db'), array('driver', 'sqlite3')); $this->sub_configuration->expects($this->any())->method('offsetGet')->will($this->returnValueMap($map)); $this->sub_configuration->expects($this->any())->method('offsetExists')->with($this->equalTo('file'))->will($this->returnValue(TRUE)); $this->logger = $this->getMock('Psr\\Log\\LoggerInterface'); $this->sqlite3 = $this->getMock('Lunr\\Gravity\\Database\\SQLite3\\LunrSQLite3'); $this->class = new SQLite3Connection($this->configuration, $this->logger, $this->sqlite3); $this->reflection = new ReflectionClass('Lunr\\Gravity\\Database\\SQLite3\\SQLite3Connection'); }
/** * TestCase Constructor. * * @return void */ public function supportedSetup() { $this->sub_configuration = $this->getMock('Lunr\\Core\\Configuration'); $this->configuration = $this->getMock('Lunr\\Core\\Configuration'); $map = array(array('db', $this->sub_configuration)); $this->configuration->expects($this->any())->method('offsetGet')->will($this->returnValueMap($map)); $map = array(array('rw_host', 'rw_host'), array('username', 'username'), array('password', 'password'), array('database', 'database'), array('driver', 'mysql')); $this->sub_configuration->expects($this->any())->method('offsetGet')->will($this->returnValueMap($map)); $this->logger = $this->getMock('Psr\\Log\\LoggerInterface'); $this->pool = new DatabaseConnectionPool($this->configuration, $this->logger); $this->pool_reflection = new ReflectionClass('Lunr\\Gravity\\Database\\DatabaseConnectionPool'); }