Skip to content

Commit

Permalink
Use getPrivateMethodInvoker() for protected Controller methods
Browse files Browse the repository at this point in the history
  • Loading branch information
MGatner authored Mar 25, 2019
1 parent 4bc261e commit a56bfdf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/system/ControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public function testCachePage()
$this->controller = new Controller();
$this->controller->initController($this->request, $this->response, $this->logger);

$this->assertNull($this->controller->cachePage(10));
$method = $this->getPrivateMethodInvoker($this->controller, 'cachePage');
$this->assertNull($method(10));
}

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

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

//--------------------------------------------------------------------
Expand Down

0 comments on commit a56bfdf

Please sign in to comment.