ILIAS  trunk Revision v11.0_alpha-1731-gff9cd7e2bd3
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
GroupTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
31 use ILIAS\Refinery\Logical\Group as LogicalGroup;
34 
35 class GroupTest extends TestCase
36 {
37  private LogicalGroup $group;
42 
43  protected function setUp(): void
44  {
45  $this->dataFactory = new DataFactory();
46  $this->language = $this->getMockBuilder(Language::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 }
A constraint encodes some resrtictions on values.
Definition: Constraint.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
language()
description: > Example for rendring a language glyph.
Definition: language.php:41