| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function testExcludes() |
||
| 19 | { |
||
| 20 | $usedOnTable = new UsedOnTable("Used On"); |
||
| 21 | $file1 = $this->objFromFixture(File::class, 'file1'); |
||
| 22 | $usedOnTable->setRecord($file1); |
||
| 23 | |||
| 24 | $response = $usedOnTable->usage(new HTTPRequest("GET", "/")); |
||
| 25 | |||
| 26 | $protocol = Director::is_https() ? 'https' : 'http'; |
||
| 27 | |||
| 28 | $expected = json_encode([ |
||
| 29 | "usage"=> [[ |
||
| 30 | "id" => 0, |
||
| 31 | "title" => "My Page", |
||
| 32 | "type" => "Page", |
||
| 33 | "state" => "Draft", |
||
| 34 | "link" => sprintf('%s://localhost/admin/pages/edit/show/1', $protocol) |
||
| 35 | ]] |
||
| 36 | ]); |
||
| 37 | $this->assertEquals($expected, $response->getBody()); |
||
| 38 | } |
||
| 40 |