function it_can_build_a_negation(Specification $spec) { $spec->getRule()->willReturn('a'); $spec->getParameters()->willReturn(['foo' => 'param a']); $negation = $this::not($spec); $negation->getRule()->shouldReturn('NOT (a)'); $negation->getParameters()->shouldReturn(['foo' => 'param a']); }
/** * Tells if a target satisfies the given specification. * The executor to use is determined at runtime using the registered ones. * * @param mixed $target The target. * @param Specification $spec The specification to use. * * @return boolean */ public function satisfiesSpec($target, Specification $spec, array $executionContext = []) { return $this->satisfies($target, $spec->getRule(), $spec->getParameters(), $executionContext); }