ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
GroupTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 use ILIAS\Refinery\Custom\Group as CustomGroup;
28 use ilLanguage;
29 
30 class GroupTest extends TestCase
31 {
32  private CustomGroup $group;
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 }