Exemple #1
0
 /**
  * @covers            Islandora\Fedora\Chullo::saveResource
  * @uses              GuzzleHttp\Client
  * @expectedException GuzzleHttp\Exception\ClientException
  */
 public function testThrowsExceptionOn409()
 {
     $mock = new MockHandler([new Response(409)]);
     $handler = HandlerStack::create($mock);
     $guzzle = new Client(['handler' => $handler, 'base_uri' => 'http://localhost:8080/fcrepo/rest']);
     $client = new Chullo($guzzle);
     $result = $client->saveResource("");
 }
 /**
  * @covers  Islandora\Fedora\Chullo::saveResource
  * @uses    GuzzleHttp\Client
  */
 public function testReturnsTrueOn204()
 {
     $mock = new MockHandler([new Response(204)]);
     $handler = HandlerStack::create($mock);
     $guzzle = new Client(['handler' => $handler]);
     $api = new FedoraApi($guzzle);
     $client = new Chullo($api);
     $result = $client->saveResource("");
     $this->assertTrue($result);
 }