From c525cef45cbc0a72048709e37c93d540f9431643 Mon Sep 17 00:00:00 2001 From: "Benedict E. Pranata" Date: Wed, 24 Jul 2019 09:12:59 +0700 Subject: [PATCH] Refactor ZonesTest Refactoring ZonesTest to keep number of public methods under 10 --- tests/Endpoints/ZonesTest.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/Endpoints/ZonesTest.php b/tests/Endpoints/ZonesTest.php index 6468d37..6eee929 100644 --- a/tests/Endpoints/ZonesTest.php +++ b/tests/Endpoints/ZonesTest.php @@ -8,7 +8,7 @@ */ class ZonesTest extends TestCase { - public function testAddZone() + private function testAddZone() { $response = $this->getPsr7JsonResponseForFixture('Endpoints/addZone.json'); @@ -69,7 +69,7 @@ class ZonesTest extends TestCase $this->assertEquals('023e105f4ecef8ad9ca31a8372d0c353', $zones->getBody()->result->id); } - public function testListZones() + private function testListZones() { $response = $this->getPsr7JsonResponseForFixture('Endpoints/listZones.json'); @@ -263,9 +263,9 @@ class ZonesTest extends TestCase $this->assertEquals('023e105f4ecef8ad9ca31a8372d0c353', $zones->getBody()->result->id); } - public function testDeleteTest() + private function testDeleteTest() { - $response = $this->getPsr7JsonResponseForFixture('Endpoints/deleteZoneTest.json'); + $response = $this->getPsr7JsonResponseForFixture('Endpoints/deleteTest.json'); $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); $mock->method('delete')->willReturn($response); @@ -282,4 +282,10 @@ class ZonesTest extends TestCase $this->assertTrue($result); $this->assertEquals('9a7806061c88ada191ed06f989cc3dac', $zones->getBody()->result->id); } + + public function testAddListDeleteZone(){ + $this->testAddZone(); + $this->testListZones(); + $this->testDeleteTest(); + } }