コード例 #1
0
 private function setStubResponse($response)
 {
     $this->phpBrowser = Stub::make('\\Codeception\\Module\\PhpBrowser', ['_getResponseContent' => $response]);
     $this->module->_inject($this->phpBrowser);
     $this->module->_initialize();
     $this->module->_before(Stub::makeEmpty('\\Codeception\\TestCase\\Cest'));
 }
コード例 #2
0
ファイル: RestTest.php プロジェクト: vladislavl-hyuna/crmapp
 private function setStubResponse($response)
 {
     $connectionModule = Stub::make('\\Codeception\\Module\\UniversalFramework', ['_getResponseContent' => $response]);
     $this->module->_inject($connectionModule);
     $this->module->_initialize();
     $this->module->_before(Stub::makeEmpty('\\Codeception\\TestCase\\Cest'));
 }
コード例 #3
0
ファイル: PhpBrowserRestTest.php プロジェクト: corcre/elabftw
 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'));
 }
コード例 #4
0
ファイル: RestTest.php プロジェクト: codeception/base
 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']);
 }