public function testExecuteWithoutViolations() { $list = new ConstraintViolationList([]); $this->validator->shouldReceive('validate')->once()->andReturn($list); $this->middleware->execute(new FakeCommand(), function () { }); }
public function testValidateDoesNotThrowExceptionIfThereAreNoErrors() { $errors = m::mock(ConstraintViolationListInterface::class); $errors->shouldReceive('count')->andReturn(0); $comment = m::mock(Validatable::class); $this->validator->shouldReceive('validate')->once()->andReturn($errors); $this->validationHandler->validate($comment); }