ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
GroupTest.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
5 
15 
16 require_once('./libs/composer/vendor/autoload.php');
17 
18 class GroupTest extends TestCase
19 {
23  private $group;
24 
28  private $dataFactory;
29 
33  private $language;
34 
39 
44 
45  public function setUp() : void
46  {
47  $this->dataFactory = new Factory();
48  $this->language = $this->getMockBuilder('\ilLanguage')
49  ->disableOriginalConstructor()
50  ->getMock();
51 
52  $this->group = new Group($this->dataFactory, $this->language);
53 
54  $this->greaterThanConstraint = new GreaterThan(2, $this->dataFactory, $this->language);
55  $this->lessThanConstaint = new LessThan(5, $this->dataFactory, $this->language);
56  }
57 
58  public function testLogicalOrGroup()
59  {
60  $instance = $this->group->logicalOr(array($this->greaterThanConstraint, $this->lessThanConstaint));
61  $this->assertInstanceOf(LogicalOr::class, $instance);
62  }
63 
64  public function testNotGroup()
65  {
66  $instance = $this->group->not($this->greaterThanConstraint);
67  $this->assertInstanceOf(Not::class, $instance);
68  }
69 
70  public function testParallelGroup()
71  {
72  $instance = $this->group->parallel(array($this->greaterThanConstraint, $this->lessThanConstaint));
73  $this->assertInstanceOf(Parallel::class, $instance);
74  }
75 
76  public function testSequentialGroup()
77  {
78  $instance = $this->group->sequential(array($this->greaterThanConstraint, $this->lessThanConstaint));
79  $this->assertInstanceOf(Sequential::class, $instance);
80  }
81 }
Builds data types.
Definition: Factory.php:19
language()
Definition: language.php:2