Пример #1
0
 /**
  * @covers            Islandora\Fedora\Chullo::rollbackTransaction
  * @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->rollbackTransaction("tx:abc-123");
 }
 /**
  * @covers            Islandora\Fedora\Chullo::rollbackTransaction
  * @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->rollbackTransaction("tx:abc-123");
     $this->assertFalse($result);
 }