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;
24use ILIAS\Refinery\Custom\Group as CustomGroup;
25use ILIAS\Refinery\Custom\Transformation as CustomTransformation;
26use ILIAS\Refinery\Custom\Constraint as CustomConstraint;
28use ilLanguage;
29
30class GroupTest extends TestCase
31{
32 private CustomGroup $group;
33 private DataFactory $dataFactory;
35
36 protected function setUp(): void
37 {
38 $this->dataFactory = new DataFactory();
39 $this->language = $this->getMockBuilder(ilLanguage::class)
40 ->disableOriginalConstructor()
41 ->getMock();
42
43 $this->group = new CustomGroup($this->dataFactory, $this->language);
44 }
45
46 public function testCustomConstraint(): void
47 {
48 $instance = $this->group->constraint(static function (): void {
49 }, 'some error');
50 $this->assertInstanceOf(CustomConstraint::class, $instance);
51 }
52
53 public function testCustomTransformation(): void
54 {
55 $instance = $this->group->transformation(static function (): void {
56 });
57 $this->assertInstanceOf(CustomTransformation::class, $instance);
58 }
59}
Builds data types.
Definition: Factory.php:21
Transform values according to custom configuration.
language handling
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: GroupTest.php:21