From b90800f04229866909002d9309fe8860b5d83fd7 Mon Sep 17 00:00:00 2001 From: nruest Date: Fri, 22 Jul 2016 16:26:41 -0400 Subject: [PATCH 1/6] Let's see what this does. --- test/CreateTransactionTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/CreateTransactionTest.php b/test/CreateTransactionTest.php index aaeee97..a1f404b 100644 --- a/test/CreateTransactionTest.php +++ b/test/CreateTransactionTest.php @@ -15,6 +15,7 @@ class CreateTransactionTest extends \PHPUnit_Framework_TestCase /** * @covers Islandora\Chullo\Chullo::createTransaction * @covers Islandora\Chullo\FedoraApi::createTransaction + * @covers Islandora\Chullo\FedoraApi::prepareUri * @uses GuzzleHttp\Client */ public function testReturnsIdOn201() @@ -34,6 +35,7 @@ public function testReturnsIdOn201() /** * @covers Islandora\Chullo\Chullo::createTransaction * @covers Islandora\Chullo\FedoraApi::createTransaction + * @covers Islandora\Chullo\FedoraApi::prepareUri * @uses GuzzleHttp\Client */ public function testReturnsNullOtherwise() From 95e7be9b6100d5a4e6cdb66c36f105545f201952 Mon Sep 17 00:00:00 2001 From: nruest Date: Fri, 22 Jul 2016 16:33:28 -0400 Subject: [PATCH 2/6] Let's see what this does... again. --- test/CreateTransactionTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/CreateTransactionTest.php b/test/CreateTransactionTest.php index a1f404b..5f96466 100644 --- a/test/CreateTransactionTest.php +++ b/test/CreateTransactionTest.php @@ -16,6 +16,9 @@ class CreateTransactionTest extends \PHPUnit_Framework_TestCase * @covers Islandora\Chullo\Chullo::createTransaction * @covers Islandora\Chullo\FedoraApi::createTransaction * @covers Islandora\Chullo\FedoraApi::prepareUri + * @covers Islandora\Chullo\FedoraApi::baseUri + * @covers Islandora\Chullo\FedoraApi::createTransaction + * @covers Islandora\Chullo\FedoraApi::generateTransaction * @uses GuzzleHttp\Client */ public function testReturnsIdOn201() @@ -36,6 +39,9 @@ public function testReturnsIdOn201() * @covers Islandora\Chullo\Chullo::createTransaction * @covers Islandora\Chullo\FedoraApi::createTransaction * @covers Islandora\Chullo\FedoraApi::prepareUri + * @covers Islandora\Chullo\FedoraApi::baseUri + * @covers Islandora\Chullo\FedoraApi::createTransaction + * @covers Islandora\Chullo\FedoraApi::generateTransaction * @uses GuzzleHttp\Client */ public function testReturnsNullOtherwise() From 63ce8348cc4ce4b141eceff3a4bc9e8cb7a6670c Mon Sep 17 00:00:00 2001 From: nruest Date: Fri, 22 Jul 2016 16:37:00 -0400 Subject: [PATCH 3/6] I can't read --- test/CreateTransactionTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/CreateTransactionTest.php b/test/CreateTransactionTest.php index 5f96466..423c5eb 100644 --- a/test/CreateTransactionTest.php +++ b/test/CreateTransactionTest.php @@ -16,9 +16,9 @@ class CreateTransactionTest extends \PHPUnit_Framework_TestCase * @covers Islandora\Chullo\Chullo::createTransaction * @covers Islandora\Chullo\FedoraApi::createTransaction * @covers Islandora\Chullo\FedoraApi::prepareUri - * @covers Islandora\Chullo\FedoraApi::baseUri + * @covers Islandora\Chullo\FedoraApi::getBaseUri * @covers Islandora\Chullo\FedoraApi::createTransaction - * @covers Islandora\Chullo\FedoraApi::generateTransaction + * @covers Islandora\Chullo\FedoraApi::generateTransactionUri * @uses GuzzleHttp\Client */ public function testReturnsIdOn201() @@ -39,9 +39,9 @@ public function testReturnsIdOn201() * @covers Islandora\Chullo\Chullo::createTransaction * @covers Islandora\Chullo\FedoraApi::createTransaction * @covers Islandora\Chullo\FedoraApi::prepareUri - * @covers Islandora\Chullo\FedoraApi::baseUri + * @covers Islandora\Chullo\FedoraApi::getBaseUri * @covers Islandora\Chullo\FedoraApi::createTransaction - * @covers Islandora\Chullo\FedoraApi::generateTransaction + * @covers Islandora\Chullo\FedoraApi::generateTransactionUri * @uses GuzzleHttp\Client */ public function testReturnsNullOtherwise() From 6e79a1a49a4d175475b181bc8e41c11f60fe2840 Mon Sep 17 00:00:00 2001 From: nruest Date: Fri, 22 Jul 2016 16:43:15 -0400 Subject: [PATCH 4/6] Add a bit more. --- test/CreateTransactionTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/CreateTransactionTest.php b/test/CreateTransactionTest.php index 423c5eb..c4c3dba 100644 --- a/test/CreateTransactionTest.php +++ b/test/CreateTransactionTest.php @@ -14,6 +14,7 @@ class CreateTransactionTest extends \PHPUnit_Framework_TestCase /** * @covers Islandora\Chullo\Chullo::createTransaction + * @covers Islandora\Chullo\Chullo::getBaseUri * @covers Islandora\Chullo\FedoraApi::createTransaction * @covers Islandora\Chullo\FedoraApi::prepareUri * @covers Islandora\Chullo\FedoraApi::getBaseUri @@ -37,6 +38,7 @@ public function testReturnsIdOn201() } /** * @covers Islandora\Chullo\Chullo::createTransaction + * @covers Islandora\Chullo\Chullo::getBaseUri * @covers Islandora\Chullo\FedoraApi::createTransaction * @covers Islandora\Chullo\FedoraApi::prepareUri * @covers Islandora\Chullo\FedoraApi::getBaseUri From c4443bf0cc41dcee9850b660899b382ac846e3ba Mon Sep 17 00:00:00 2001 From: nruest Date: Fri, 22 Jul 2016 17:27:18 -0400 Subject: [PATCH 5/6] I hope this is sane. --- test/CreateTransactionTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/CreateTransactionTest.php b/test/CreateTransactionTest.php index c4c3dba..7da2f84 100644 --- a/test/CreateTransactionTest.php +++ b/test/CreateTransactionTest.php @@ -26,6 +26,7 @@ public function testReturnsIdOn201() { $mock = new MockHandler([ new Response(201, ['Location' => "http://localhost:8080/fcrepo/rest/tx:abc-123"]), + new Response(201, ['Location' => "http://localhost:8080/fcrepo/rest/tx:abc-123"]), ]); $handler = HandlerStack::create($mock); @@ -33,6 +34,11 @@ public function testReturnsIdOn201() $api = new FedoraApi($guzzle); $client = new Chullo($api); + $this->assertEquals($client->getBaseUri(), 'http://localhost:8080/fcrepo/rest'); + + $result = $client->createResource(); + $this->assertSame($result, 'http://localhost:8080/fcrepo/rest/tx:abc-123'); + $result = $client->createTransaction(); $this->assertSame($result, "tx:abc-123"); } From 61682bedd775808da276bfcb703c61085ef94e2b Mon Sep 17 00:00:00 2001 From: nruest Date: Tue, 26 Jul 2016 09:12:33 -0400 Subject: [PATCH 6/6] Welp, that didn't work. --- test/CreateTransactionTest.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/CreateTransactionTest.php b/test/CreateTransactionTest.php index 7da2f84..fb53681 100644 --- a/test/CreateTransactionTest.php +++ b/test/CreateTransactionTest.php @@ -26,7 +26,6 @@ public function testReturnsIdOn201() { $mock = new MockHandler([ new Response(201, ['Location' => "http://localhost:8080/fcrepo/rest/tx:abc-123"]), - new Response(201, ['Location' => "http://localhost:8080/fcrepo/rest/tx:abc-123"]), ]); $handler = HandlerStack::create($mock); @@ -36,9 +35,6 @@ public function testReturnsIdOn201() $this->assertEquals($client->getBaseUri(), 'http://localhost:8080/fcrepo/rest'); - $result = $client->createResource(); - $this->assertSame($result, 'http://localhost:8080/fcrepo/rest/tx:abc-123'); - $result = $client->createTransaction(); $this->assertSame($result, "tx:abc-123"); }