From 274517553c4eaf4eca86b7592beb6f68bbfde845 Mon Sep 17 00:00:00 2001 From: "Benedict E. Pranata" Date: Wed, 24 Jul 2019 09:22:27 +0700 Subject: [PATCH] Create ZoneDeleteTest.php --- tests/Endpoints/ZoneDeleteTest.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/Endpoints/ZoneDeleteTest.php diff --git a/tests/Endpoints/ZoneDeleteTest.php b/tests/Endpoints/ZoneDeleteTest.php new file mode 100644 index 0000000..aa0ff2f --- /dev/null +++ b/tests/Endpoints/ZoneDeleteTest.php @@ -0,0 +1,19 @@ +getPsr7JsonResponseForFixture('Endpoints/deleteTest.json'); + $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); + $mock->method('delete')->willReturn($response); + $mock->expects($this->once()) + ->method('delete') + ->with( + $this->equalTo('zones/023e105f4ecef8ad9ca31a8372d0c353') + ); + $zones = new \Cloudflare\API\Endpoints\Zones($mock); + $result = $zones->deleteZone('023e105f4ecef8ad9ca31a8372d0c353'); + $this->assertTrue($result); + $this->assertEquals('9a7806061c88ada191ed06f989cc3dac', $zones->getBody()->result->id); + } +}