PageRulesActionTest.php 736 B

12345678910111213141516171819202122
  1. <?php
  2. use Cloudflare\API\Configurations\PageRulesActions;
  3. class PageRulesActionTest extends TestCase
  4. {
  5. public function testForwardingURLConfigurationIsApplied()
  6. {
  7. $identifier = 'forwarding_url';
  8. $statusCode = 301;
  9. $forwardingURL = 'https://www.example.org/';
  10. $actions = new PageRulesActions();
  11. $actions->setForwardingURL($statusCode, $forwardingURL);
  12. $configuration = $actions->getArray();
  13. $this->assertCount(1, $configuration);
  14. $this->assertEquals($identifier, $configuration[0]['id']);
  15. $this->assertEquals($statusCode, $configuration[0]['value']['status_code']);
  16. $this->assertEquals($forwardingURL, $configuration[0]['value']['url']);
  17. }
  18. }