Skip to content

Commit a56bfdf

Browse files
authored
Use getPrivateMethodInvoker() for protected Controller methods
1 parent 4bc261e commit a56bfdf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/system/ControllerTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ public function testCachePage()
8787
$this->controller = new Controller();
8888
$this->controller->initController($this->request, $this->response, $this->logger);
8989

90-
$this->assertNull($this->controller->cachePage(10));
90+
$method = $this->getPrivateMethodInvoker($this->controller, 'cachePage');
91+
$this->assertNull($method(10));
9192
}
9293

9394
public function testValidate()
@@ -97,7 +98,8 @@ public function testValidate()
9798
$this->controller->initController($this->request, $this->response, $this->logger);
9899

99100
// and that we can attempt validation, with no rules
100-
$this->assertFalse($this->controller->validate([]));
101+
$method = $this->getPrivateMethodInvoker($this->controller, 'validate');
102+
$this->assertFalse($method([]));
101103
}
102104

103105
//--------------------------------------------------------------------

0 commit comments

Comments
 (0)