ILIAS  release_8 Revision v8.24
DimensionTest Class Reference
+ Inheritance diagram for DimensionTest:
+ Collaboration diagram for DimensionTest:

Public Member Functions

 testCardinaltLabels ()
 
 testRangeLabels ()
 
 testCardinalNumericValues ()
 
 testCardinalNullValue ()
 
 testCardinalInvalidValue ()
 
 testRangeNullValue ()
 
 testRangeNumericValues ()
 
 testRangeInvalidArray ()
 
 testRangeInvalidCount ()
 
 testRangeInvalidValues ()
 

Protected Member Functions

 setUp ()
 

Detailed Description

Definition at line 27 of file DimensionTest.php.

Member Function Documentation

◆ setUp()

DimensionTest::setUp ( )
protected

Definition at line 29 of file DimensionTest.php.

29 : void
30 {
31 $this->f = new Dimension\Factory();
32 }

◆ testCardinalInvalidValue()

DimensionTest::testCardinalInvalidValue ( )

Definition at line 75 of file DimensionTest.php.

75 : void
76 {
77 try {
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);
83 }
84 }
$c
Definition: cli.php:38

References $c, and Vendor\Package\$e.

◆ testCardinalNullValue()

DimensionTest::testCardinalNullValue ( )

Definition at line 64 of file DimensionTest.php.

64 : void
65 {
66 try {
67 $c = $this->f->cardinal();
68 $c->checkValue(null);
69 $this->assertTrue(true);
70 } catch (\InvalidArgumentException $e) {
71 $this->assertFalse("This should not happen.");
72 }
73 }

References $c, and Vendor\Package\$e.

◆ testCardinalNumericValues()

DimensionTest::testCardinalNumericValues ( )

Definition at line 50 of file DimensionTest.php.

50 : void
51 {
52 try {
53 $c = $this->f->cardinal();
54 $c->checkValue(-2);
55 $c->checkValue(0);
56 $c->checkValue(0.5);
57 $c->checkValue("1.5");
58 $this->assertTrue(true);
59 } catch (\InvalidArgumentException $e) {
60 $this->assertFalse("This should not happen.");
61 }
62 }

References $c, and Vendor\Package\$e.

◆ testCardinaltLabels()

DimensionTest::testCardinaltLabels ( )

Definition at line 34 of file DimensionTest.php.

34 : void
35 {
36 $labels = ["label1", "label2", "label3"];
37 $c = $this->f->cardinal($labels);
38 $this->assertEquals($labels, $c->getLabels());
39 }

References $c.

◆ testRangeInvalidArray()

DimensionTest::testRangeInvalidArray ( )

Definition at line 111 of file DimensionTest.php.

111 : void
112 {
113 try {
114 $c = $this->f->cardinal();
115 $r = $this->f->range($c);
116 $r->checkValue(2);
117 $this->assertFalse("This should not happen.");
118 } catch (\InvalidArgumentException $e) {
119 $this->assertTrue(true);
120 }
121 }

References $c, and Vendor\Package\$e.

◆ testRangeInvalidCount()

DimensionTest::testRangeInvalidCount ( )

Definition at line 123 of file DimensionTest.php.

123 : void
124 {
125 try {
126 $c = $this->f->cardinal();
127 $r = $this->f->range($c);
128 $r->checkValue([2]);
129 $this->assertFalse("This should not happen.");
130 } catch (\InvalidArgumentException $e) {
131 $this->assertTrue(true);
132 }
133 }

References $c, and Vendor\Package\$e.

◆ testRangeInvalidValues()

DimensionTest::testRangeInvalidValues ( )

Definition at line 135 of file DimensionTest.php.

135 : void
136 {
137 try {
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);
144 }
145 }

References $c, and Vendor\Package\$e.

◆ testRangeLabels()

DimensionTest::testRangeLabels ( )

Definition at line 41 of file DimensionTest.php.

41 : void
42 {
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());
48 }

References $c.

◆ testRangeNullValue()

DimensionTest::testRangeNullValue ( )

Definition at line 86 of file DimensionTest.php.

86 : void
87 {
88 try {
89 $c = $this->f->cardinal();
90 $r = $this->f->range($c);
91 $r->checkValue(null);
92 $this->assertTrue(true);
93 } catch (\InvalidArgumentException $e) {
94 $this->assertFalse("This should not happen.");
95 }
96 }

References $c, and Vendor\Package\$e.

◆ testRangeNumericValues()

DimensionTest::testRangeNumericValues ( )

Definition at line 98 of file DimensionTest.php.

98 : void
99 {
100 try {
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.");
108 }
109 }

References $c, and Vendor\Package\$e.


The documentation for this class was generated from the following file: