当前位置: 首页>>代码示例>>PHP>>正文


PHP Configuration::expects方法代码示例

本文整理汇总了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');
 }
开发者ID:rubendgr,项目名称:lunr,代码行数:16,代码来源:ViewTest.php

示例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');
 }
开发者ID:rubendgr,项目名称:lunr,代码行数:16,代码来源:MySQLConnectionTest.php

示例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');
 }
开发者ID:rubendgr,项目名称:lunr,代码行数:20,代码来源:SQLite3ConnectionTest.php

示例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');
 }
开发者ID:rubendgr,项目名称:lunr,代码行数:17,代码来源:DatabaseConnectionPoolTest.php


注:本文中的Configuration::expects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。