Beispiel #1
0
 protected function setUp()
 {
     parent::setUp();
     $this->httpHost = getenv('EZP_TEST_REST_HOST') ?: 'localhost';
     $this->httpAuth = getenv('EZP_TEST_REST_AUTH') ?: 'admin:publish';
     $this->httpClient = new \Buzz\Client\Curl();
     $this->httpClient->setVerifyPeer(false);
     $this->httpClient->setTimeout(90);
     $this->httpClient->setOption(CURLOPT_FOLLOWLOCATION, false);
 }
Beispiel #2
0
 protected function setUp()
 {
     parent::setUp();
     if (!($this->httpHost = getenv('EZP_TEST_REST_HOST'))) {
         self::markTestSkipped('Set the EZP_TEST_REST_HOST (api.example.com) to your eZ Publish test instance');
     }
     if (!($this->httpAuth = getenv('EZP_TEST_REST_AUTH'))) {
         self::markTestSkipped('Set the EZP_TEST_REST_AUTH (admin:publish) to your eZ Publish test instance');
     }
     $this->httpClient = new \Buzz\Client\Curl();
     $this->httpClient->setVerifyPeer(false);
     $this->httpClient->setTimeout(90);
     $this->httpClient->setOption(CURLOPT_FOLLOWLOCATION, false);
 }
 protected function setUp()
 {
     parent::setUp();
     $this->httpHost = getenv('EZP_TEST_REST_HOST') ?: 'localhost';
     $this->httpAuth = getenv('EZP_TEST_REST_AUTH') ?: 'admin:publish';
     list($this->loginUsername, $this->loginPassword) = explode(':', $this->httpAuth);
     $this->httpClient = new \Buzz\Client\Curl();
     $this->httpClient->setVerifyPeer(false);
     $this->httpClient->setTimeout(90);
     $this->httpClient->setOption(CURLOPT_FOLLOWLOCATION, false);
     if ($this->autoLogin) {
         $session = $this->login();
         $this->headers[] = sprintf('Cookie: %s=%s', $session->name, $session->identifier);
         $this->headers[] = sprintf('X-CSRF-Token: %s', $session->csrfToken);
     }
 }