예제 #1
0
 /**
  * @covers            Islandora\Fedora\Chullo::extendTransaction
  * @uses              GuzzleHttp\Client
  * @expectedException GuzzleHttp\Exception\ClientException
  */
 public function testThrowsExceptionOn410()
 {
     $mock = new MockHandler([new Response(410)]);
     $handler = HandlerStack::create($mock);
     $guzzle = new Client(['handler' => $handler, 'base_uri' => 'http://localhost:8080/fcrepo/rest']);
     $client = new Chullo($guzzle);
     $result = $client->extendTransaction("tx:abc-123");
 }
예제 #2
0
 /**
  * @covers            Islandora\Fedora\Chullo::extendTransaction
  * @uses              GuzzleHttp\Client
  */
 public function testReturnsFalseOtherwise()
 {
     $mock = new MockHandler([new Response(410)]);
     $handler = HandlerStack::create($mock);
     $guzzle = new Client(['handler' => $handler]);
     $api = new FedoraApi($guzzle);
     $client = new Chullo($api);
     $result = $client->extendTransaction("tx:abc-123");
     $this->assertFalse($result);
 }