當前位置: 首頁>>代碼示例>>PHP>>正文


PHP make_container函數代碼示例

本文整理匯總了PHP中make_container函數的典型用法代碼示例。如果您正苦於以下問題:PHP make_container函數的具體用法?PHP make_container怎麽用?PHP make_container使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了make_container函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testLoginToFacebook

 public function testLoginToFacebook()
 {
     $this->markTestSkipped();
     // preconditions: #1 php web server being run
     $browserModule = new PhpBrowser(make_container());
     $browserModule->_setConfig(array('url' => 'http://localhost:8000'));
     $browserModule->_initialize();
     $browserModule->_cleanup();
     $browserModule->_before($this->makeTest());
     SuiteManager::$modules['PhpBrowser'] = $browserModule;
     // preconditions: #2 facebook test user was created
     $this->module->haveFacebookTestUserAccount();
     $testUserName = $this->module->grabFacebookTestUserName();
     // preconditions: #3 test user logged in on facebook
     $this->module->haveTestUserLoggedInOnFacebook();
     // go to our page with facebook login button
     $browserModule->amOnPage('/facebook');
     // check that yet we are not logged in with facebook
     $browserModule->see('You are not Connected.');
     // click on "Login with Facebook" button to start login with facebook
     $browserModule->click('Login with Facebook');
     // check that we are logged in with facebook
     $browserModule->see('Your User Object (/me)');
     $browserModule->see($testUserName);
     // cleanup
     unset(SuiteManager::$modules['PhpBrowser']);
     $browserModule->_after($this->makeTest());
     data::clean();
 }
開發者ID:hitechdk,項目名稱:Codeception,代碼行數:29,代碼來源:FacebookTest.php

示例2: testExceptionFails

 /**
  * @expectedException PHPUnit_Framework_AssertionFailedError
  */
 public function testExceptionFails()
 {
     $module = new \Codeception\Module\Asserts(make_container());
     $module->expectException(new Exception('here', 200), function () {
         throw new Exception('here', 2);
     });
 }
開發者ID:solutionDrive,項目名稱:Codeception,代碼行數:10,代碼來源:AssertsTest.php

示例3: testAsserts

 public function testAsserts()
 {
     $module = new \Codeception\Module\Asserts(make_container());
     $module->assertEquals(1, 1);
     $module->assertContains(1, [1, 2]);
     $module->assertSame(1, 1);
     $module->assertNotSame(1, true);
 }
開發者ID:namnv609,項目名稱:Codeception,代碼行數:8,代碼來源:AssertsTest.php

示例4: setUp

 public function setUp()
 {
     $this->module = new \Codeception\Module\SOAP(make_container());
     $this->module->_setConfig(array('schema' => 'http://www.w3.org/2001/xml.xsd', 'endpoint' => 'http://codeception.com/api/wsdl'));
     $this->layout = \Codeception\Configuration::dataDir() . '/xml/layout.xml';
     $this->module->isFunctional = true;
     $this->module->_before(Stub::makeEmpty('\\Codeception\\Test\\Test'));
     $this->module->client = Stub::makeEmpty('\\Codeception\\Lib\\Connector\\Universal');
 }
開發者ID:foxman209,項目名稱:Codeception,代碼行數:9,代碼來源:SoapTest.php

示例5: testCreateSnapshotOnFail

 public function testCreateSnapshotOnFail()
 {
     $module = Stub::construct(get_class($this->module), [make_container()], ['_savePageSource' => Stub::once(function ($filename) {
         $this->assertEquals(codecept_log_dir('Codeception.Module.UniversalFramework.looks.like..test.fail.html'), $filename);
     })]);
     $module->amOnPage('/');
     $cest = new \Codeception\Test\Cest($this->module, 'looks:like::test', 'demo1Cest.php');
     $module->_failed($cest, new PHPUnit_Framework_AssertionFailedError());
 }
開發者ID:solutionDrive,項目名稱:Codeception,代碼行數:9,代碼來源:FrameworksTest.php

示例6: testSequences

 public function testSequences()
 {
     $module = new \Codeception\Module\Sequence(make_container());
     $this->assertNotEquals(sq(), sq());
     $this->assertNotEquals(sq(1), sq(2));
     $this->assertEquals(sq(1), sq(1));
     $old = sq(1);
     $module->_after($this);
     $this->assertNotEquals($old, sq(1));
 }
開發者ID:foxman209,項目名稱:Codeception,代碼行數:10,代碼來源:SequenceTest.php

示例7: testAsserts

 public function testAsserts()
 {
     $module = new \Codeception\Module\Asserts(make_container());
     $module->assertEquals(1, 1);
     $module->assertContains(1, [1, 2]);
     $module->assertSame(1, 1);
     $module->assertNotSame(1, true);
     $module->assertRegExp('/^[\\d]$/', '1');
     $module->assertNotRegExp('/^[a-z]$/', '1');
 }
開發者ID:azonwan,項目名稱:pingju,代碼行數:10,代碼來源:AssertsTest.php

示例8: setUp

 public function setUp()
 {
     $this->noPhpWebserver();
     $this->noSelenium();
     $this->module = new \Codeception\Module\WebDriver(make_container());
     $url = 'http://localhost:8000';
     $this->module->_setConfig(['url' => $url, 'browser' => 'firefox', 'port' => '4444', 'restart' => true, 'wait' => 0]);
     $this->module->_initialize();
     $this->module->_before($this->makeTest());
     $this->webDriver = $this->module->webDriver;
 }
開發者ID:Marfuz,項目名稱:c4t_test,代碼行數:11,代碼來源:WebDriverTest.php

示例9: setUp

 public function setUp()
 {
     $this->module = new \Codeception\Module\Queue(make_container());
     $this->module->_setConfig($this->config);
     $this->module->_before(Stub::makeEmpty('\\Codeception\\TestCase'));
     try {
         $this->module->clearQueue('default');
     } catch (\Pheanstalk_Exception_ConnectionException $e) {
         $this->markTestSkipped("Beanstalk is not running");
     }
 }
開發者ID:foxman209,項目名稱:Codeception,代碼行數:11,代碼來源:Beanstalkd_Test.php

示例10: setUp

 public function setUp()
 {
     $this->module = new \Codeception\Module\AMQP(make_container());
     $this->module->_setConfig($this->config);
     $res = stream_socket_client('tcp://localhost:5672');
     if ($res === false) {
         $this->markTestSkipped('AMQP is not running');
     }
     $this->module->_initialize();
     $connection = $this->module->connection;
     $connection->channel()->queue_declare('queue1');
 }
開發者ID:solutionDrive,項目名稱:Codeception,代碼行數:12,代碼來源:AMQPTest.php

示例11: setUp

 public function setUp()
 {
     $this->phpBrowser = new \Codeception\Module\PhpBrowser(make_container());
     $url = 'http://localhost:8010';
     $this->phpBrowser->_setConfig(array('url' => $url));
     $this->phpBrowser->_initialize();
     $this->module = Stub::make('\\Codeception\\Module\\REST');
     $this->module->_inject($this->phpBrowser);
     $this->module->_initialize();
     $this->module->_before(Stub::makeEmpty('\\Codeception\\TestCase\\Cest'));
     $this->phpBrowser->_before(Stub::makeEmpty('\\Codeception\\TestCase\\Cest'));
 }
開發者ID:nsgomez,項目名稱:Codeception,代碼行數:12,代碼來源:PhpBrowserRestTest.php

示例12: setUp

 public function setUp()
 {
     $connector = new \Codeception\Lib\Connector\Universal();
     $connector->setIndex(\Codeception\Configuration::dataDir() . '/rest/index.php');
     $connectionModule = new \Codeception\Module\PhpBrowser(make_container());
     $this->module = Stub::make('\\Codeception\\Module\\REST');
     $this->module->_inject($connectionModule);
     $this->module->_initialize();
     $this->module->_before(Stub::makeEmpty('\\Codeception\\TestCase\\Cest'));
     $this->module->client = $connector;
     $this->module->client->setServerParameters(['SCRIPT_FILENAME' => 'index.php', 'SCRIPT_NAME' => 'index', 'SERVER_NAME' => 'localhost', 'SERVER_PROTOCOL' => 'http']);
 }
開發者ID:codeception,項目名稱:base,代碼行數:12,代碼來源:RestTest.php

示例13: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     self::$module = new \Codeception\Module\Db(make_container());
     self::$module->_setConfig(self::$config);
     self::$module->_initialize();
     $sqlite = self::$module->driver;
     $sqlite->cleanup();
     $sql = file_get_contents(\Codeception\Configuration::dataDir() . '/dumps/sqlite.sql');
     $sql = preg_replace('%/\\*(?:(?!\\*/).)*\\*/%s', "", $sql);
     $sql = explode("\n", $sql);
     $sqlite->load($sql);
 }
開發者ID:hitechdk,項目名稱:Codeception,代碼行數:12,代碼來源:DbTest.php

示例14: setUp

 protected function setUp()
 {
     if (!class_exists('Mongo')) {
         $this->markTestSkipped('Mongo is not installed');
     }
     $mongo = new \MongoClient();
     $this->module = new MongoDb(make_container());
     $this->module->_setConfig($this->mongoConfig);
     $this->module->_initialize();
     $this->db = $mongo->selectDB('test');
     $this->userCollection = $this->db->createCollection('users');
     $this->userCollection->insert(array('id' => 1, 'email' => 'miles@davis.com'));
 }
開發者ID:hitechdk,項目名稱:Codeception,代碼行數:13,代碼來源:MongoDbTest.php

示例15: setUp

 public function setUp()
 {
     $this->testCase = Stub::make('\\Codeception\\TestCase');
     $module = new \Codeception\Module\Dbh(make_container());
     try {
         $driver = Driver::create($this->config['dsn'], $this->config['user'], $this->config['password']);
         $module::$dbh = $driver->getDbh();
     } catch (\PDOException $e) {
         $this->markTestSkipped('Coudn\'t establish connection to database');
         return;
     }
     $this->module = $module;
 }
開發者ID:hitechdk,項目名稱:Codeception,代碼行數:13,代碼來源:DbhTest.php


注:本文中的make_container函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。