Tests working with color data object.
More...
◆ setUp()
Definition at line 16 of file ColorTest.php.
18 $this->f =
new Data\Factory();
◆ tearDown()
◆ testDarkness()
ColorTest::testDarkness |
( |
| ) |
|
Definition at line 132 of file ColorTest.php.
134 $v = $this->f->color(
'#6541f4');
135 $this->assertEquals(
true, $v->isDark());
◆ testDarkness2()
ColorTest::testDarkness2 |
( |
| ) |
|
Definition at line 138 of file ColorTest.php.
140 $v = $this->f->color(
'#c1f441');
141 $this->assertEquals(
false, $v->isDark());
◆ testFullHexValue()
ColorTest::testFullHexValue |
( |
| ) |
|
Definition at line 26 of file ColorTest.php.
28 $v = $this->f->color(
'#0fff2f');
30 $this->assertEquals(
'#0fff2f', $v->asHex());
31 $this->assertEquals(
'rgb(15, 255, 47)', $v->asRGBString());
32 $this->assertEquals(array(15, 255, 47), $v->asArray());
33 $this->assertEquals(15, $v->r());
34 $this->assertEquals(255, $v->g());
35 $this->assertEquals(47, $v->b());
◆ testRBGValue()
ColorTest::testRBGValue |
( |
| ) |
|
Definition at line 54 of file ColorTest.php.
56 $v = $this->f->color(array(15,255,47));
57 $this->assertEquals(
'#0fff2f', $v->asHex());
58 $this->assertEquals(
'rgb(15, 255, 47)', $v->asRGBString());
59 $this->assertEquals(array(15, 255, 47), $v->asArray());
◆ testShortHexValue()
ColorTest::testShortHexValue |
( |
| ) |
|
Definition at line 38 of file ColorTest.php.
40 $v = $this->f->color(
'#f0f');
41 $this->assertEquals(
'#ff00ff', $v->asHex());
42 $this->assertEquals(
'rgb(255, 0, 255)', $v->asRGBString());
43 $this->assertEquals(array(255, 0, 255), $v->asArray());
◆ testShortHexValue2()
ColorTest::testShortHexValue2 |
( |
| ) |
|
Definition at line 46 of file ColorTest.php.
48 $v = $this->f->color(
'f0f');
49 $this->assertEquals(
'#ff00ff', $v->asHex());
50 $this->assertEquals(
'rgb(255, 0, 255)', $v->asRGBString());
51 $this->assertEquals(array(255, 0, 255), $v->asArray());
◆ testWrongHexValue()
ColorTest::testWrongHexValue |
( |
| ) |
|
Definition at line 102 of file ColorTest.php.
References Vendor\Package\$e.
105 $v = $this->f->color(
'1234');
106 $this->assertFalse(
"This should not happen.");
108 $this->assertTrue(
true);
◆ testWrongHexValue2()
ColorTest::testWrongHexValue2 |
( |
| ) |
|
Definition at line 112 of file ColorTest.php.
References Vendor\Package\$e.
115 $v = $this->f->color(
'#ff');
116 $this->assertFalse(
"This should not happen.");
118 $this->assertTrue(
true);
◆ testWrongHexValue4()
ColorTest::testWrongHexValue4 |
( |
| ) |
|
Definition at line 122 of file ColorTest.php.
References Vendor\Package\$e.
125 $v = $this->f->color(
'#gg0000');
126 $this->assertFalse(
"This should not happen.");
128 $this->assertTrue(
true);
◆ testWrongRBGValue()
ColorTest::testWrongRBGValue |
( |
| ) |
|
Definition at line 62 of file ColorTest.php.
References Vendor\Package\$e.
65 $v = $this->f->color(array(-1,0,0));
66 $this->assertFalse(
"This should not happen.");
68 $this->assertTrue(
true);
◆ testWrongRBGValue2()
ColorTest::testWrongRBGValue2 |
( |
| ) |
|
Definition at line 72 of file ColorTest.php.
References Vendor\Package\$e.
75 $v = $this->f->color(array(256,0,0));
76 $this->assertFalse(
"This should not happen.");
78 $this->assertTrue(
true);
◆ testWrongRBGValue3()
ColorTest::testWrongRBGValue3 |
( |
| ) |
|
Definition at line 82 of file ColorTest.php.
References Vendor\Package\$e.
85 $v = $this->f->color(array(1,1,
'123'));
86 $this->assertFalse(
"This should not happen.");
88 $this->assertTrue(
true);
◆ testWrongRBGValue4()
ColorTest::testWrongRBGValue4 |
( |
| ) |
|
Definition at line 92 of file ColorTest.php.
References Vendor\Package\$e.
95 $v = $this->f->color(array());
96 $this->assertFalse(
"This should not happen.");
98 $this->assertTrue(
true);
The documentation for this class was generated from the following file: