Ejemplo n.º 1
0
 public function testCurlFailure()
 {
     $connection = new Connection(self::$fakeDomain);
     $this->mockCurl(function ($mockCurl) {
         $mockCurl->get()->once()->return_value(self::$fakeApiResponseFailure);
     });
     $this->setExpectedException('\\Bart\\Jenkins\\JenkinsApiException');
     $connection->curlJenkinsApi(self::$fakeApiPath);
 }
Ejemplo n.º 2
0
 /**
  * @see getJson but with POST data
  * @param array $resourceItems
  * @param array $httpPostArray
  * @return array JSON data decoded as PHP array
  */
 private function postJson(array $resourceItems, array $httpPostArray)
 {
     return $this->connection->curlJenkinsApi($this->buildApiPath($resourceItems), $httpPostArray);
 }