3declare(strict_types=1);
22require_once(
'./libs/composer/vendor/autoload.php');
25use PHPUnit\Framework\TestCase;
29 protected function setUp(): void
36 $labels = [
"label1",
"label2",
"label3"];
37 $c = $this->f->cardinal($labels);
38 $this->assertEquals($labels,
$c->getLabels());
43 $labels = [
"label1",
"label2",
"label3"];
44 $c = $this->f->cardinal($labels);
45 $r = $this->f->range(
$c);
46 $this->assertEquals($labels, $r->getLabels());
47 $this->assertEquals(
$c->getLabels(), $r->getLabels());
53 $c = $this->f->cardinal();
57 $c->checkValue(
"1.5");
58 $this->assertTrue(
true);
59 }
catch (\InvalidArgumentException
$e) {
60 $this->assertFalse(
"This should not happen.");
67 $c = $this->f->cardinal();
69 $this->assertTrue(
true);
70 }
catch (\InvalidArgumentException
$e) {
71 $this->assertFalse(
"This should not happen.");
78 $c = $this->f->cardinal();
79 $c->checkValue(
"A value");
80 $this->assertFalse(
"This should not happen.");
81 }
catch (\InvalidArgumentException
$e) {
82 $this->assertTrue(
true);
89 $c = $this->f->cardinal();
90 $r = $this->f->range(
$c);
92 $this->assertTrue(
true);
93 }
catch (\InvalidArgumentException
$e) {
94 $this->assertFalse(
"This should not happen.");
101 $c = $this->f->cardinal();
102 $r = $this->f->range(
$c);
103 $r->checkValue([-2, 0]);
104 $r->checkValue([0.5,
"1.5"]);
105 $this->assertTrue(
true);
106 }
catch (\InvalidArgumentException
$e) {
107 $this->assertFalse(
"This should not happen.");
114 $c = $this->f->cardinal();
115 $r = $this->f->range(
$c);
117 $this->assertFalse(
"This should not happen.");
118 }
catch (\InvalidArgumentException
$e) {
119 $this->assertTrue(
true);
126 $c = $this->f->cardinal();
127 $r = $this->f->range(
$c);
129 $this->assertFalse(
"This should not happen.");
130 }
catch (\InvalidArgumentException
$e) {
131 $this->assertTrue(
true);
138 $c = $this->f->cardinal();
139 $r = $this->f->range(
$c);
140 $r->checkValue([2,
"A value"]);
141 $this->assertFalse(
"This should not happen.");
142 }
catch (\InvalidArgumentException
$e) {
143 $this->assertTrue(
true);
testCardinalInvalidValue()
testCardinalNumericValues()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...