19declare(strict_types=1);
32use PHPUnit\Framework\TestCase;
34use PHPUnit\Framework\MockObject\Stub;
44 protected function setUp(): void
46 $this->dataFactory =
new DataFactory();
47 $this->
language = $this->createStub(Language::class);
49 $this->group =
new LogicalGroup($this->dataFactory, $this->
language);
52 $this->lessThanConstaint =
new LessThan(5, $this->dataFactory, $this->
language);
57 $instance = $this->group->logicalOr([$this->greaterThanConstraint, $this->lessThanConstaint]);
58 $this->assertInstanceOf(LogicalOr::class, $instance);
63 $instance = $this->group->not($this->greaterThanConstraint);
64 $this->assertInstanceOf(Not::class, $instance);
69 $instance = $this->group->parallel([$this->greaterThanConstraint, $this->lessThanConstaint]);
70 $this->assertInstanceOf(Parallel::class, $instance);
75 $instance = $this->group->sequential([$this->greaterThanConstraint, $this->lessThanConstaint]);
76 $this->assertInstanceOf(Sequential::class, $instance);
Constraint $lessThanConstaint
Constraint $greaterThanConstraint
A constraint encodes some resrtictions on values.