19declare(strict_types=1);
21require_once(
'./vendor/composer/vendor/autoload.php');
24use PHPUnit\Framework\TestCase;
30 protected function setUp(): void
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);
60 }
catch (\InvalidArgumentException
$e) {
61 $this->assertFalse(
"This should not happen.");
68 $c = $this->f->cardinal();
70 $this->assertTrue(
true);
71 }
catch (\InvalidArgumentException
$e) {
72 $this->assertFalse(
"This should not happen.");
79 $c = $this->f->cardinal();
80 $c->checkValue(
"A value");
81 $this->assertFalse(
"This should not happen.");
82 }
catch (\InvalidArgumentException
$e) {
83 $this->assertTrue(
true);
90 $c = $this->f->cardinal();
91 $r = $this->f->range(
$c);
93 $this->assertTrue(
true);
94 }
catch (\InvalidArgumentException
$e) {
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);
107 }
catch (\InvalidArgumentException
$e) {
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.");
119 }
catch (\InvalidArgumentException
$e) {
120 $this->assertTrue(
true);
127 $c = $this->f->cardinal();
128 $r = $this->f->range(
$c);
130 $this->assertFalse(
"This should not happen.");
131 }
catch (\InvalidArgumentException
$e) {
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.");
143 }
catch (\InvalidArgumentException
$e) {
144 $this->assertTrue(
true);
testCardinalInvalidValue()
testCardinalNumericValues()