public function postEdit() { $input = Input::all(); try { $obj = $this->f->process($input); } catch (PalmabitExceptionsInterface $e) { $errors = $this->f->getErrors(); return Redirect::action("Palmabit\\Catalog\\Controllers\\CategoryController@getEdit")->withInput()->withErrors($errors); } return Redirect::action("Palmabit\\Catalog\\Controllers\\CategoryController@getEdit", ["slug_lang" => $obj->slug_lang])->with(["message" => "Categoria modificata con successo."]); }
/** * @expectedException Palmabit\Library\Exceptions\NotFoundException */ public function testProcessThrowNotFound() { $stub_validator = new ValidatorInterfaceStub(); $mock_repo = m::mock('StdClass')->shouldReceive('update')->andThrow(new \Palmabit\Library\Exceptions\NotFoundException())->getMock(); $form = new FormModel($stub_validator, $mock_repo); $form->process(array("id" => "1")); }
public function postChangeOrder() { $input = Input::all(); $validator = new ProductFormOrderValidator(); $form_model = new FormModel($validator, $this->r); try { $obj = $form_model->process($input); } catch (PalmabitExceptionsInterface $e) { $errors = $form_model->getErrors(); return Redirect::action("Palmabit\\Catalog\\Controllers\\ProductsController@lists")->withInput()->withErrors($errors); } return Redirect::action("Palmabit\\Catalog\\Controllers\\ProductsController@lists")->with(array("message" => "Ordine modificato con successo.")); }