| Conditions | 1 |
| Paths | 1 |
| Total Lines | 32 |
| Code Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 23 | public function testChangeOptions() |
||
| 24 | { |
||
| 25 | //Disable the curl request as we are only checking the URL |
||
| 26 | $CF = $this->getCloudflare(); |
||
| 27 | $CF->diableRequests(); |
||
| 28 | |||
| 29 | $options = [ |
||
| 30 | 'status' => 'pending', |
||
| 31 | 'page' => 2, |
||
| 32 | 'per_page' => 50, |
||
| 33 | 'order' => 'name', |
||
| 34 | 'direction' => 'desc', |
||
| 35 | 'match' => 'any', |
||
| 36 | ]; |
||
| 37 | $domain = 'test.com'; |
||
| 38 | |||
| 39 | $this->Zone->get('test.com', $options); |
||
| 40 | $RequestURL = $this->Zone->getRequestURL(); |
||
| 41 | $this->assertNotNull($RequestURL, "Request URL was null"); |
||
| 42 | |||
| 43 | $sting = explode('zones?', $RequestURL)[1]; |
||
| 44 | |||
| 45 | $shouldBe = "name=" . $domain |
||
| 46 | . "&status=" . $options['status'] |
||
| 47 | . "&page=" . $options['page'] |
||
| 48 | . "&per_page=" . $options['per_page'] |
||
| 49 | . "&order=" . $options['order'] |
||
| 50 | . "&direction=" . $options['direction'] |
||
| 51 | . "&match=". $options['match']; |
||
| 52 | |||
| 53 | $this->assertSame($sting, $shouldBe, 'Request URL is not correct'); |
||
| 54 | } |
||
| 55 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: