ZoneDeleteTest.php 778 B

1234567891011121314151617181920
  1. <?php
  2. class ZoneDeleteTest extends TestCase
  3. {
  4. public function testDeleteTest()
  5. {
  6. $response = $this->getPsr7JsonResponseForFixture('Endpoints/deleteZoneTest.json');
  7. $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock();
  8. $mock->method('delete')->willReturn($response);
  9. $mock->expects($this->once())
  10. ->method('delete')
  11. ->with(
  12. $this->equalTo('zones/023e105f4ecef8ad9ca31a8372d0c353')
  13. );
  14. $zones = new \Cloudflare\API\Endpoints\Zones($mock);
  15. $result = $zones->deleteZone('023e105f4ecef8ad9ca31a8372d0c353');
  16. $this->assertTrue($result);
  17. $this->assertEquals('9a7806061c88ada191ed06f989cc3dac', $zones->getBody()->result->id);
  18. }
  19. }