6use PHPUnit\Framework\TestCase;
15 protected static $labels = array(
"A",
"B",
"C");
23 protected function setUp() : void
26 $language = $this->createMock(
'\ilLanguage');
29 $this->add_label = $this->f->container()->addLabels(self::$labels);
35 $this->add_label =
null;
40 $with = $this->add_label->transform(self::$test_array);
41 $this->assertEquals(self::$result_array, $with);
49 $next_with = $this->add_label->transform($with);
50 }
catch (InvalidArgumentException
$e) {
53 $this->assertTrue($raised);
57 $without = array(1, 2, 3, 4);
58 $with = $this->add_label->transform($without);
59 }
catch (InvalidArgumentException
$e) {
62 $this->assertTrue($raised);
67 $with = $this->add_label->transform($without);
68 }
catch (InvalidArgumentException
$e) {
71 $this->assertTrue($raised);
76 $with = $this->add_label->transform($std_class);
77 }
catch (InvalidArgumentException
$e) {
80 $this->assertTrue($raised);
85 $add_label = $this->f->container()->addLabels(self::$labels);
86 $with = $add_label(self::$test_array);
87 $this->assertEquals(self::$result_array, $with);
92 $add_label = $this->f->container()->addLabels(self::$labels);
97 $next_with = $add_label($with);
98 }
catch (InvalidArgumentException
$e) {
101 $this->assertTrue($raised);
105 $without = array(1, 2, 3, 4);
106 $with = $add_label($without);
107 }
catch (InvalidArgumentException
$e) {
110 $this->assertTrue($raised);
114 $without =
"1, 2, 3";
115 $with = $add_label($without);
116 }
catch (InvalidArgumentException
$e) {
119 $this->assertTrue($raised);
124 $with = $add_label($std_class);
125 }
catch (InvalidArgumentException
$e) {
128 $this->assertTrue($raised);
TestCase for AddLabel transformations.
An exception for terminatinating execution or to throw for unit testing.