public function test_Should_FailToSave_When_ValidationFails() { $this->mockValidator->shouldReceive('with')->once()->andReturn($this->mockValidator); $this->mockValidator->shouldReceive('passes')->once()->andReturn(false); $input = ['recipe_id_order' => '3,1,2', 'deploy_path' => '']; $form = new ProjectForm($this->mockValidator, $this->mockProjectRepository); $result = $form->save($input); $this->assertFalse($result, 'Expected save to fail.'); }