function it_is_not_fine_with_abstract_methods_with_body(Method $method)
 {
     $method->isAbstract()->willReturn(true);
     $method->getBody()->willReturn('');
     $method->getName()->willReturn('__construct');
     $this->validate($method)->shouldHaveType('Memio\\Validator\\Violation\\SomeViolation');
 }
 function it_is_not_fine_with_abstract_and_private_methods(Method $method)
 {
     $method->isAbstract()->willReturn(true);
     $method->getVisibility()->willReturn('private');
     $method->getName()->willReturn('__construct');
     $this->validate($method)->shouldHaveType('Memio\\Validator\\Violation\\SomeViolation');
 }
 function it_is_not_fine_with_concrete_object_and_abstract_methods(Object $object, Method $method)
 {
     $object->getName()->willReturn('ConcreteClass');
     $object->isAbstract()->willReturn(false);
     $object->allMethods()->willReturn(array($method));
     $method->isAbstract()->willReturn(true);
     $method->getName()->willReturn('abstractClass');
     $this->validate($object)->shouldHaveType('Memio\\Validator\\Violation\\SomeViolation');
 }
Exemplo n.º 4
0
 function it_also_validates_arguments(ArgumentValidator $argumentValidator, CollectionValidator $collectionValidator, Method $model)
 {
     $arguments = array();
     $violationCollection1 = new ViolationCollection();
     $violationCollection2 = new ViolationCollection();
     $model->isAbstract()->willReturn(false);
     $model->allArguments()->willReturn($arguments);
     $collectionValidator->validate($arguments)->willReturn($violationCollection1);
     $argumentValidator->validate($arguments)->willReturn($violationCollection2);
     $this->validate($model);
 }