예제 #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
 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
 public function setUp()
 {
     $connector = new \Codeception\Lib\Connector\Universal();
     $connector->setIndex(\Codeception\Configuration::dataDir() . '/rest/index.php');
     $this->module = Stub::make('\\Codeception\\Module\\REST', ['getModules' => [new \Codeception\Module\PhpBrowser()]]);
     $this->module->_initialize();
     $this->module->_before(Stub::makeEmpty('\\Codeception\\TestCase\\Cest'));
     $this->module->client = $connector;
     $this->module->client->setServerParameters(array('SCRIPT_FILENAME' => 'index.php', 'SCRIPT_NAME' => 'index', 'SERVER_NAME' => 'localhost', 'SERVER_PROTOCOL' => 'http'));
 }
예제 #4
0
 public function setUp()
 {
     $this->phpBrowser = new \Codeception\Module\PhpBrowser();
     $url = 'http://localhost:8010';
     $this->phpBrowser->_setConfig(array('url' => $url));
     $this->phpBrowser->_initialize();
     $this->module = Stub::make('\\Codeception\\Module\\REST', ['getModules' => [$this->phpBrowser]]);
     $this->module->_initialize();
     $this->module->_before(Stub::makeEmpty('\\Codeception\\TestCase\\Cest'));
     $this->phpBrowser->_before(Stub::makeEmpty('\\Codeception\\TestCase\\Cest'));
 }
예제 #5
0
    public function setUp() {
        $this->phpBrowser = new \Codeception\Module\PhpBrowser();
        $url = 'http://localhost:8010';
        $this->phpBrowser->_setConfig(array('url' => $url));
        $this->phpBrowser->_initialize();
        $this->phpBrowser->_before(Stub::makeEmpty('\Codeception\TestCase\Cest'));

        $this->module = new \Codeception\Module\REST();
        $this->module->_initialize();
        $this->module->client = $this->phpBrowser->client;
        $this->module->_before(Stub::makeEmpty('\Codeception\TestCase\Cest'));

    }