19declare(strict_types=1);
23use PHPUnit\Framework\TestCase;
29 private static array
$labels = [
"A",
"B",
"C"];
38 protected function setUp(): void
40 $dataFactory =
new DataFactory();
41 $language = $this->createMock(
ILIAS\Language\Language::class);
43 $this->f =
new Refinery($dataFactory, $language);
44 $this->add_label = $this->f->container()->addLabels(self::$labels);
50 $this->add_label =
null;
55 $with = $this->add_label->transform(self::$test_array);
56 $this->assertEquals(self::$result_array, $with);
64 $next_with = $this->add_label->transform($with);
65 }
catch (InvalidArgumentException
$e) {
68 $this->assertTrue($raised);
72 $without = [1, 2, 3, 4];
73 $with = $this->add_label->transform($without);
74 }
catch (InvalidArgumentException
$e) {
77 $this->assertTrue($raised);
82 $with = $this->add_label->transform($without);
83 }
catch (InvalidArgumentException
$e) {
86 $this->assertTrue($raised);
90 $std_class =
new stdClass();
91 $with = $this->add_label->transform($std_class);
92 }
catch (InvalidArgumentException
$e) {
95 $this->assertTrue($raised);
100 $add_label = $this->f->container()->addLabels(self::$labels);
102 $this->assertEquals(self::$result_array, $with);
107 $add_label = $this->f->container()->addLabels(self::$labels);
113 }
catch (InvalidArgumentException
$e) {
116 $this->assertTrue($raised);
120 $without = [1, 2, 3, 4];
122 }
catch (InvalidArgumentException
$e) {
125 $this->assertTrue($raised);
129 $without =
"1, 2, 3";
131 }
catch (InvalidArgumentException
$e) {
134 $this->assertTrue($raised);
138 $std_class =
new stdClass();
140 }
catch (InvalidArgumentException
$e) {
143 $this->assertTrue($raised);
static array $result_array
Transformation $add_label
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.