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')); }
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')); }
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')); }
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']); }