ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 ()
 

Protected Attributes

Dimension Factory $f
 

Detailed Description

Definition at line 27 of file DimensionTest.php.

Member Function Documentation

◆ setUp()

DimensionTest::setUp ( )
protected

Definition at line 31 of file DimensionTest.php.

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

◆ testCardinalInvalidValue()

DimensionTest::testCardinalInvalidValue ( )

Definition at line 77 of file DimensionTest.php.

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

77  : void
78  {
79  try {
80  $c = $this->f->cardinal();
81  $c->checkValue("A value");
82  $this->assertFalse("This should not happen.");
83  } catch (\InvalidArgumentException $e) {
84  $this->assertTrue(true);
85  }
86  }

◆ testCardinalNullValue()

DimensionTest::testCardinalNullValue ( )

Definition at line 66 of file DimensionTest.php.

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

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

◆ testCardinalNumericValues()

DimensionTest::testCardinalNumericValues ( )

Definition at line 52 of file DimensionTest.php.

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

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

◆ testCardinaltLabels()

DimensionTest::testCardinaltLabels ( )

Definition at line 36 of file DimensionTest.php.

References Vendor\Package\$c.

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

◆ testRangeInvalidArray()

DimensionTest::testRangeInvalidArray ( )

Definition at line 113 of file DimensionTest.php.

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

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

◆ testRangeInvalidCount()

DimensionTest::testRangeInvalidCount ( )

Definition at line 125 of file DimensionTest.php.

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

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

◆ testRangeInvalidValues()

DimensionTest::testRangeInvalidValues ( )

Definition at line 137 of file DimensionTest.php.

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

137  : void
138  {
139  try {
140  $c = $this->f->cardinal();
141  $r = $this->f->range($c);
142  $r->checkValue([2, "A value"]);
143  $this->assertFalse("This should not happen.");
144  } catch (\InvalidArgumentException $e) {
145  $this->assertTrue(true);
146  }
147  }
$r

◆ testRangeLabels()

DimensionTest::testRangeLabels ( )

Definition at line 43 of file DimensionTest.php.

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

43  : void
44  {
45  $labels = ["label1", "label2", "label3"];
46  $c = $this->f->cardinal($labels);
47  $r = $this->f->range($c);
48  $this->assertEquals($labels, $r->getLabels());
49  $this->assertEquals($c->getLabels(), $r->getLabels());
50  }
$r

◆ testRangeNullValue()

DimensionTest::testRangeNullValue ( )

Definition at line 88 of file DimensionTest.php.

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

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

◆ testRangeNumericValues()

DimensionTest::testRangeNumericValues ( )

Definition at line 100 of file DimensionTest.php.

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

100  : void
101  {
102  try {
103  $c = $this->f->cardinal();
104  $r = $this->f->range($c);
105  $r->checkValue([-2, 0]);
106  $r->checkValue([0.5, "1.5"]);
107  $this->assertTrue(true);
108  } catch (\InvalidArgumentException $e) {
109  $this->assertFalse("This should not happen.");
110  }
111  }
$r

Field Documentation

◆ $f

Dimension Factory DimensionTest::$f
protected

Definition at line 29 of file DimensionTest.php.


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