ILIAS  release_8 Revision v8.24
GroupTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22
23use ILIAS\Data\Factory as DataFactory;
31use ILIAS\Refinery\Logical\Group as LogicalGroup;
33use ilLanguage;
34
35class GroupTest extends TestCase
36{
37 private LogicalGroup $group;
38 private DataFactory $dataFactory;
42
43 protected function setUp(): void
44 {
45 $this->dataFactory = new DataFactory();
46 $this->language = $this->getMockBuilder(ilLanguage::class)
47 ->disableOriginalConstructor()
48 ->getMock();
49
50 $this->group = new LogicalGroup($this->dataFactory, $this->language);
51
52 $this->greaterThanConstraint = new GreaterThan(2, $this->dataFactory, $this->language);
53 $this->lessThanConstaint = new LessThan(5, $this->dataFactory, $this->language);
54 }
55
56 public function testLogicalOrGroup(): void
57 {
58 $instance = $this->group->logicalOr([$this->greaterThanConstraint, $this->lessThanConstaint]);
59 $this->assertInstanceOf(LogicalOr::class, $instance);
60 }
61
62 public function testNotGroup(): void
63 {
64 $instance = $this->group->not($this->greaterThanConstraint);
65 $this->assertInstanceOf(Not::class, $instance);
66 }
67
68 public function testParallelGroup(): void
69 {
70 $instance = $this->group->parallel([$this->greaterThanConstraint, $this->lessThanConstaint]);
71 $this->assertInstanceOf(Parallel::class, $instance);
72 }
73
74 public function testSequentialGroup(): void
75 {
76 $instance = $this->group->sequential([$this->greaterThanConstraint, $this->lessThanConstaint]);
77 $this->assertInstanceOf(Sequential::class, $instance);
78 }
79}
Builds data types.
Definition: Factory.php:21
language handling
A constraint encodes some resrtictions on values.
Definition: Constraint.php:32
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: GroupTest.php:21