/** * Gets the service definition when an API version is supplied * @group integration */ public function testPing() { $version = "1.0.1"; $config = new Config(array('endpoint' => $GLOBALS['endpoint'], 'username' => $GLOBALS['adminUsername'], 'password' => $GLOBALS['adminPassword'])); $this->client = new Client($config); $this->assertTrue($this->client->ping()); }
/** * Ping returns false when the publish service responds with an error * @group unit */ public function testPingFail() { $pingResponse = array("weirdresponse" => "failed"); Phockito::when($this->mockResponse->getStatusCode())->return(200); Phockito::when($this->mockResponse->json())->return($pingResponse); Phockito::when($this->mockRequest->send())->return($this->mockResponse); Phockito::when($this->client)->get(anything())->return($this->mockRequest); $this->assertFalse($this->client->ping()); }