ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
GroupTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use ILIAS\Refinery\KindlyTo\Group as KindlyToGroup;
32use PHPUnit\Framework\TestCase;
33
34class GroupTest extends TestCase
35{
36 private KindlyToGroup $basicGroup;
37
38 protected function setUp(): void
39 {
40 $this->basicGroup = new KindlyToGroup(new \ILIAS\Data\Factory());
41 }
42
43 public function testIsStringTransformationInstance(): void
44 {
45 $transformation = $this->basicGroup->string();
46 $this->assertInstanceOf(StringTransformation::class, $transformation);
47 }
48
50 {
51 $transformation = $this->basicGroup->bool();
52 $this->assertInstanceOf(BooleanTransformation::class, $transformation);
53 }
54
56 {
57 $transformation = $this->basicGroup->dateTime();
58 $this->assertInstanceOf(DateTimeTransformation::class, $transformation);
59 }
60
62 {
63 $transformation = $this->basicGroup->int();
64 $this->assertInstanceOf(IntegerTransformation::class, $transformation);
65 }
66
67 public function testIsFloatTransformationInterface(): void
68 {
69 $transformation = $this->basicGroup->float();
70 $this->assertInstanceOf(FloatTransformation::class, $transformation);
71 }
72
74 {
75 $transformation = $this->basicGroup->recordOf(['tostring' => new StringTransformation()]);
76 $this->assertInstanceOf(RecordTransformation::class, $transformation);
77 }
78
79 public function testIsTupleTransformationInterface(): void
80 {
81 $transformation = $this->basicGroup->tupleOf([new StringTransformation()]);
82 $this->assertInstanceOf(TupleTransformation::class, $transformation);
83 }
84
85 public function testNewDictionaryTransformation(): void
86 {
87 $transformation = $this->basicGroup->dictOf(new StringTransformation());
88 $this->assertInstanceOf(DictionaryTransformation::class, $transformation);
89 }
90}
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
Transformations in this group transform data to primitive types to establish a baseline for more comp...
Definition: Group.php:48
Transform date format to DateTimeImmutable Please note:
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.