Exemplo n.º 1
0
 /**
  * @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"));
 }
Exemplo n.º 2
0
 public function delete()
 {
     $input = Input::all();
     try {
         $this->f->delete($input);
     } catch (PalmabitExceptionsInterface $e) {
         $errors = $this->f->getErrors();
         return Redirect::action("Palmabit\\Catalog\\Controllers\\CategoryController@lists")->withErrors($errors);
     }
     return Redirect::action("Palmabit\\Catalog\\Controllers\\CategoryController@lists")->with(array("message" => "Categoria eliminata con successo."));
 }
Exemplo n.º 3
0
 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."));
 }