function it_does_not_add_violation_if_subject_is_disabled(ExecutionContextInterface $context, Constraints\Disabled $constraint, ToggleableInterface $subject) { $subject->isEnabled()->shouldBeCalled()->willReturn(false); $context->addViolation(Argument::cetera())->shouldNotBeCalled(); $this->validate($subject, $constraint); }
function it_does_not_add_violation_if_subject_is_enabled(ExecutionContextInterface $context, ToggleableInterface $subject) { $subject->isEnabled()->shouldBeCalled()->willReturn(true); $context->addViolation(Argument::cetera())->shouldNotBeCalled(); $this->validate($subject, new Enabled()); }