當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。