public function update(array $input)
{
if (!$this->valid($input)) {
return false;
}
return $this->server->update($input);
}
public function test_Should_FailToUpdate_When_ValidationFails() { $this->mockValidator->shouldReceive('with')->once()->andReturn($this->mockValidator); $this->mockValidator->shouldReceive('passes')->once()->andReturn(false); $form = new ServerForm($this->mockValidator, $this->mockServerRepository); $result = $form->update([]); $this->assertFalse($result, 'Expected update to fail.'); }