File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,14 @@ public function satisfies(Specification $specification): bool
1414 return $ specification ->isSatisfiedBy ($ this );
1515 }
1616
17+ /**
18+ * @param Specification<self> $specification
19+ */
20+ public function dissatisfies (Specification $ specification ): bool
21+ {
22+ return (new NotSpecification ($ specification ))->isSatisfiedBy ($ this );
23+ }
24+
1725 /**
1826 * @deprecated use `satisfies()` instead
1927 *
Original file line number Diff line number Diff line change @@ -23,5 +23,8 @@ public function test_it_should_pass_the_candidate_to_the_specification(): void
2323 // Act + Assert
2424 $ this ->assertTrue ($ candidate ->satisfies (new PositiveSpecification ()));
2525 $ this ->assertFalse ($ candidate ->satisfies (new NegativeSpecification ()));
26+
27+ $ this ->assertFalse ($ candidate ->dissatisfies (new PositiveSpecification ()));
28+ $ this ->assertTrue ($ candidate ->dissatisfies (new NegativeSpecification ()));
2629 }
2730}
You can’t perform that action at this time.
0 commit comments