lithium\tests\cases\action\ControllerTest::testProtectedMethodAccessAttempt PHP Метод

testProtectedMethodAccessAttempt() публичный Метод

Verifies that protected methods (i.e. prefixed with '_'), and methods declared in the Controller base class cannot be accessed.
    public function testProtectedMethodAccessAttempt()
    {
        $postsController = new MockPostsController();
        $this->assertException('/^Attempted to invoke a private method/', function () use($postsController) {
            $postsController->__invoke(null, array('action' => 'redirect'));
        });
        $postsController = new MockPostsController();
        $this->assertException('/^Attempted to invoke a private method/', function () use($postsController) {
            $postsController->__invoke(null, array('action' => '_safe'));
        });
    }