本文整理汇总了PHP中Configuration::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP Configuration::expects方法的具体用法?PHP Configuration::expects怎么用?PHP Configuration::expects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configuration
的用法示例。
在下文中一共展示了Configuration::expects方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
/**
* 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');
}
示例2: setUp
/**
* 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');
}
示例3: setUp
/**
* 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');
}
示例4: supportedSetup
/**
* 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');
}