/** * @test */ public function shouldInvokeFunctionCallback() { //given SampleController::$beforeActionResult = true; SampleController::$beforeCallback = function ($controller) { $controller->redirect('url'); return true; }; Route::any('/sample/action', 'sample#action'); //when $this->get('/sample/action'); //then $this->assertRedirectsTo('url'); }
/** * Proxy for getModel. * @since 1.6 */ public function &getModel($name = 'Movies', $prefix = 'SampleModel', $config = array()) { $model = parent::getModel($name, $prefix, array('ignore_request' => true)); return $model; }