/** * @covers Islandora\Fedora\Chullo::deleteResource * @uses GuzzleHttp\Client * @expectedException GuzzleHttp\Exception\ClientException */ public function testThrowsExceptionOn404() { $mock = new MockHandler([new Response(404)]); $handler = HandlerStack::create($mock); $guzzle = new Client(['handler' => $handler, 'base_uri' => 'http://localhost:8080/fcrepo/rest']); $client = new Chullo($guzzle); $result = $client->deleteResource(""); }
/** * @covers Islandora\Fedora\Chullo::deleteResource * @uses GuzzleHttp\Client */ public function testReturnsFalseOtherwise() { $mock = new MockHandler([new Response(404)]); $handler = HandlerStack::create($mock); $guzzle = new Client(['handler' => $handler]); $api = new FedoraApi($guzzle); $client = new Chullo($api); $result = $client->deleteResource(""); $this->assertFalse($result); }