App\Services\Form\Server\ServerForm::update PHP Method

update() public method

Update an existing server.
public update ( array $input ) : boolean
$input array Data to update a server
return boolean
    public function update(array $input)
    {
        if (!$this->valid($input)) {
            return false;
        }
        return $this->server->update($input);
    }

Usage Example

Beispiel #1
0
 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.');
 }