19 declare(strict_types=1);
21 require_once(
'./vendor/composer/vendor/autoload.php');
28 protected Dimension\Factory
$f;
30 protected function setUp(): void
32 $this->f =
new Dimension\Factory();
37 $labels = [
"label1",
"label2",
"label3"];
38 $c = $this->f->cardinal($labels);
39 $this->assertEquals($labels,
$c->getLabels());
44 $labels = [
"label1",
"label2",
"label3"];
45 $c = $this->f->cardinal($labels);
46 $r = $this->f->range(
$c);
47 $this->assertEquals($labels,
$r->getLabels());
48 $this->assertEquals(
$c->getLabels(),
$r->getLabels());
54 $c = $this->f->cardinal();
58 $c->checkValue(
"1.5");
59 $this->assertTrue(
true);
61 $this->assertFalse(
"This should not happen.");
68 $c = $this->f->cardinal();
70 $this->assertTrue(
true);
72 $this->assertFalse(
"This should not happen.");
79 $c = $this->f->cardinal();
80 $c->checkValue(
"A value");
81 $this->assertFalse(
"This should not happen.");
83 $this->assertTrue(
true);
90 $c = $this->f->cardinal();
91 $r = $this->f->range(
$c);
93 $this->assertTrue(
true);
95 $this->assertFalse(
"This should not happen.");
102 $c = $this->f->cardinal();
103 $r = $this->f->range(
$c);
104 $r->checkValue([-2, 0]);
105 $r->checkValue([0.5,
"1.5"]);
106 $this->assertTrue(
true);
108 $this->assertFalse(
"This should not happen.");
115 $c = $this->f->cardinal();
116 $r = $this->f->range(
$c);
118 $this->assertFalse(
"This should not happen.");
120 $this->assertTrue(
true);
127 $c = $this->f->cardinal();
128 $r = $this->f->range(
$c);
130 $this->assertFalse(
"This should not happen.");
132 $this->assertTrue(
true);
139 $c = $this->f->cardinal();
140 $r = $this->f->range(
$c);
141 $r->checkValue([2,
"A value"]);
142 $this->assertFalse(
"This should not happen.");
144 $this->assertTrue(
true);
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
testCardinalNumericValues()
testCardinalInvalidValue()