Extends
lithium\test\Unit
Verifies that protected methods (i.e. prefixed with '_'), and methods declared in the
Controller base class cannot be accessed.
Returns
voidSource
public function testProtectedMethodAccessAttempt() {
$postsController = new MockPostsController();
$this->expectException('/^Attempted to invoke a private method/');
$result = $postsController->__invoke(null, array('action' => 'redirect'));
$this->assertEqual($result->body, null);
$this->assertEqual($result->headers(), array());
$postsController = new MockPostsController();
$this->expectException('/^Private/');
$result = $postsController->invoke('_safe');
$this->assertEqual($result->body, null);
$this->assertEqual($result->headers(), array());
}