Definition at line 26 of file DimensionTest.php.
◆ setUp()
Definition at line 30 of file DimensionTest.php.
30 : void
31 {
32 $this->f = new Dimension\Factory();
33 }
◆ testCardinalInvalidValue()
DimensionTest::testCardinalInvalidValue |
( |
| ) |
|
Definition at line 76 of file DimensionTest.php.
76 : void
77 {
78 try {
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);
84 }
85 }
References $c, and Vendor\Package\$e.
◆ testCardinalNullValue()
DimensionTest::testCardinalNullValue |
( |
| ) |
|
Definition at line 65 of file DimensionTest.php.
65 : void
66 {
67 try {
68 $c = $this->f->cardinal();
70 $this->assertTrue(true);
71 }
catch (\InvalidArgumentException
$e) {
72 $this->assertFalse("This should not happen.");
73 }
74 }
References $c, and Vendor\Package\$e.
◆ testCardinalNumericValues()
DimensionTest::testCardinalNumericValues |
( |
| ) |
|
Definition at line 51 of file DimensionTest.php.
51 : void
52 {
53 try {
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.");
62 }
63 }
References $c, and Vendor\Package\$e.
◆ testCardinaltLabels()
DimensionTest::testCardinaltLabels |
( |
| ) |
|
Definition at line 35 of file DimensionTest.php.
35 : void
36 {
37 $labels = ["label1", "label2", "label3"];
38 $c = $this->f->cardinal($labels);
39 $this->assertEquals($labels,
$c->getLabels());
40 }
References $c.
◆ testRangeInvalidArray()
DimensionTest::testRangeInvalidArray |
( |
| ) |
|
Definition at line 112 of file DimensionTest.php.
112 : void
113 {
114 try {
115 $c = $this->f->cardinal();
116 $r = $this->f->range(
$c);
117 $r->checkValue(2);
118 $this->assertFalse("This should not happen.");
119 }
catch (\InvalidArgumentException
$e) {
120 $this->assertTrue(true);
121 }
122 }
References $c, and Vendor\Package\$e.
◆ testRangeInvalidCount()
DimensionTest::testRangeInvalidCount |
( |
| ) |
|
Definition at line 124 of file DimensionTest.php.
124 : void
125 {
126 try {
127 $c = $this->f->cardinal();
128 $r = $this->f->range(
$c);
129 $r->checkValue([2]);
130 $this->assertFalse("This should not happen.");
131 }
catch (\InvalidArgumentException
$e) {
132 $this->assertTrue(true);
133 }
134 }
References $c, and Vendor\Package\$e.
◆ testRangeInvalidValues()
DimensionTest::testRangeInvalidValues |
( |
| ) |
|
Definition at line 136 of file DimensionTest.php.
136 : void
137 {
138 try {
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);
145 }
146 }
References $c, and Vendor\Package\$e.
◆ testRangeLabels()
DimensionTest::testRangeLabels |
( |
| ) |
|
Definition at line 42 of file DimensionTest.php.
42 : void
43 {
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());
49 }
References $c.
◆ testRangeNullValue()
DimensionTest::testRangeNullValue |
( |
| ) |
|
Definition at line 87 of file DimensionTest.php.
87 : void
88 {
89 try {
90 $c = $this->f->cardinal();
91 $r = $this->f->range(
$c);
92 $r->checkValue(null);
93 $this->assertTrue(true);
94 }
catch (\InvalidArgumentException
$e) {
95 $this->assertFalse("This should not happen.");
96 }
97 }
References $c, and Vendor\Package\$e.
◆ testRangeNumericValues()
DimensionTest::testRangeNumericValues |
( |
| ) |
|
Definition at line 99 of file DimensionTest.php.
99 : void
100 {
101 try {
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.");
109 }
110 }
References $c, and Vendor\Package\$e.
◆ $f
The documentation for this class was generated from the following file: