Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function testGetEditForm() |
||
18 | { |
||
19 | $id = $this->idFromFixture(SiteTree::class, 'page_one'); |
||
20 | |||
21 | $controller = CMSPageHistoryViewerController::create(); |
||
22 | $controller->setRequest( |
||
23 | (new HTTPRequest('GET', '/')) |
||
24 | ->setSession(new Session([])) |
||
25 | ); |
||
26 | |||
27 | $result = $controller->getEditForm($id); |
||
28 | $this->assertInstanceOf(Form::class, $result); |
||
29 | |||
30 | $historyViewer = $result->Fields()->fieldByName('PageHistory'); |
||
31 | $this->assertInstanceOf(HistoryViewerField::class, $historyViewer, 'Field is injected'); |
||
32 | $this->assertSame($result, $historyViewer->getForm(), 'Correct form is injected'); |
||
33 | } |
||
35 |