From 616eccf9ea0fe18904b1ee4249b1b0429d7cb0bc Mon Sep 17 00:00:00 2001 From: Samuel Chiriluta Date: Tue, 23 May 2017 11:25:33 +0300 Subject: [PATCH 1/5] Allow postService() method to set description property You cannot set `description` for a new service right now, I see the patchService() method have it, so I added it also for the creation. --- src/Identity/v3/Api.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Identity/v3/Api.php b/src/Identity/v3/Api.php index 3f1b0bf6..f1386d90 100644 --- a/src/Identity/v3/Api.php +++ b/src/Identity/v3/Api.php @@ -61,6 +61,7 @@ public function postServices(): array 'params' => [ 'name' => $this->params->name('service'), 'type' => $this->params->type('service'), + 'description' => $this->params->desc('service'), ] ]; } From 04f54d6f3179fe38f8ebb69569cea2bae59d007b Mon Sep 17 00:00:00 2001 From: Samuel Chiriluta Date: Tue, 23 May 2017 11:51:50 +0300 Subject: [PATCH 2/5] Updated tests for createService --- tests/integration/Identity/v3/CoreTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/Identity/v3/CoreTest.php b/tests/integration/Identity/v3/CoreTest.php index c26735e7..2533a395 100644 --- a/tests/integration/Identity/v3/CoreTest.php +++ b/tests/integration/Identity/v3/CoreTest.php @@ -147,7 +147,7 @@ public function domains() public function endpoints() { - $service = $this->getService()->createService(['name' => $this->randomStr(), 'type' => 'volume']); + $service = $this->getService()->createService(['name' => $this->randomStr(), 'type' => 'volume', 'description' => $this->randomStr()]); $replacements = [ '{endpointName}' => $this->randomStr(), From 9932a43d5b538d9b8fae5a3e27b9e3ef3ab733a1 Mon Sep 17 00:00:00 2001 From: Samuel Chiriluta Date: Tue, 23 May 2017 11:56:01 +0300 Subject: [PATCH 3/5] Updated tests for createService() --- tests/unit/Identity/v3/ServiceTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/Identity/v3/ServiceTest.php b/tests/unit/Identity/v3/ServiceTest.php index 2d94c499..825ce751 100644 --- a/tests/unit/Identity/v3/ServiceTest.php +++ b/tests/unit/Identity/v3/ServiceTest.php @@ -157,7 +157,7 @@ public function test_it_revokes_token() public function test_it_creates_service() { - $userOptions = ['name' => 'foo', 'type' => 'bar']; + $userOptions = ['name' => 'foo', 'type' => 'bar', 'description' => 'description']; $this->setupMock('POST', 'services', ['service' => $userOptions], [], 'service'); From 4d7124638ce0f76d0a10ee7cb583a9e1e846125d Mon Sep 17 00:00:00 2001 From: Samuel Chiriluta Date: Tue, 23 May 2017 11:58:50 +0300 Subject: [PATCH 4/5] Update service.resp --- tests/unit/Identity/v3/Fixtures/service.resp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/unit/Identity/v3/Fixtures/service.resp b/tests/unit/Identity/v3/Fixtures/service.resp index b2eb960c..0b3713b5 100644 --- a/tests/unit/Identity/v3/Fixtures/service.resp +++ b/tests/unit/Identity/v3/Fixtures/service.resp @@ -5,6 +5,7 @@ Content-Type: application/json "service": { "id": "serviceId", "name": "foo", - "type": "bar" + "type": "bar", + "description": "description", } -} \ No newline at end of file +} From 97900a565671308b2660c0f95a649e96727530fe Mon Sep 17 00:00:00 2001 From: Samuel Chiriluta Date: Wed, 24 May 2017 08:48:32 +0300 Subject: [PATCH 5/5] Update service.resp --- tests/unit/Identity/v3/Fixtures/service.resp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/Identity/v3/Fixtures/service.resp b/tests/unit/Identity/v3/Fixtures/service.resp index 0b3713b5..e4009290 100644 --- a/tests/unit/Identity/v3/Fixtures/service.resp +++ b/tests/unit/Identity/v3/Fixtures/service.resp @@ -6,6 +6,6 @@ Content-Type: application/json "id": "serviceId", "name": "foo", "type": "bar", - "description": "description", + "description": "description" } }