Tests working with color data object.
More...
◆ setUp()
Definition at line 15 of file ColorTest.php.
17 $this->f =
new Data\Factory();
◆ tearDown()
◆ testDarkness()
ColorTest::testDarkness |
( |
| ) |
|
Definition at line 131 of file ColorTest.php.
133 $v = $this->f->color(
'#6541f4');
134 $this->assertEquals(
true, $v->isDark());
◆ testDarkness2()
ColorTest::testDarkness2 |
( |
| ) |
|
Definition at line 137 of file ColorTest.php.
139 $v = $this->f->color(
'#c1f441');
140 $this->assertEquals(
false, $v->isDark());
◆ testFullHexValue()
ColorTest::testFullHexValue |
( |
| ) |
|
Definition at line 25 of file ColorTest.php.
27 $v = $this->f->color(
'#0fff2f');
29 $this->assertEquals(
'#0fff2f', $v->asHex());
30 $this->assertEquals(
'rgb(15, 255, 47)', $v->asRGBString());
31 $this->assertEquals(array(15, 255, 47), $v->asArray());
32 $this->assertEquals(15, $v->r());
33 $this->assertEquals(255, $v->g());
34 $this->assertEquals(47, $v->b());
◆ testRBGValue()
ColorTest::testRBGValue |
( |
| ) |
|
Definition at line 53 of file ColorTest.php.
55 $v = $this->f->color(array(15,255,47));
56 $this->assertEquals(
'#0fff2f', $v->asHex());
57 $this->assertEquals(
'rgb(15, 255, 47)', $v->asRGBString());
58 $this->assertEquals(array(15, 255, 47), $v->asArray());
◆ testShortHexValue()
ColorTest::testShortHexValue |
( |
| ) |
|
Definition at line 37 of file ColorTest.php.
39 $v = $this->f->color(
'#f0f');
40 $this->assertEquals(
'#ff00ff', $v->asHex());
41 $this->assertEquals(
'rgb(255, 0, 255)', $v->asRGBString());
42 $this->assertEquals(array(255, 0, 255), $v->asArray());
◆ testShortHexValue2()
ColorTest::testShortHexValue2 |
( |
| ) |
|
Definition at line 45 of file ColorTest.php.
47 $v = $this->f->color(
'f0f');
48 $this->assertEquals(
'#ff00ff', $v->asHex());
49 $this->assertEquals(
'rgb(255, 0, 255)', $v->asRGBString());
50 $this->assertEquals(array(255, 0, 255), $v->asArray());
◆ testWrongHexValue()
ColorTest::testWrongHexValue |
( |
| ) |
|
Definition at line 101 of file ColorTest.php.
104 $v = $this->f->color(
'1234');
105 $this->assertFalse(
"This should not happen.");
107 $this->assertTrue(
true);
◆ testWrongHexValue2()
ColorTest::testWrongHexValue2 |
( |
| ) |
|
Definition at line 111 of file ColorTest.php.
114 $v = $this->f->color(
'#ff');
115 $this->assertFalse(
"This should not happen.");
117 $this->assertTrue(
true);
◆ testWrongHexValue4()
ColorTest::testWrongHexValue4 |
( |
| ) |
|
Definition at line 121 of file ColorTest.php.
124 $v = $this->f->color(
'#gg0000');
125 $this->assertFalse(
"This should not happen.");
127 $this->assertTrue(
true);
◆ testWrongRBGValue()
ColorTest::testWrongRBGValue |
( |
| ) |
|
Definition at line 61 of file ColorTest.php.
64 $v = $this->f->color(array(-1,0,0));
65 $this->assertFalse(
"This should not happen.");
67 $this->assertTrue(
true);
◆ testWrongRBGValue2()
ColorTest::testWrongRBGValue2 |
( |
| ) |
|
Definition at line 71 of file ColorTest.php.
74 $v = $this->f->color(array(256,0,0));
75 $this->assertFalse(
"This should not happen.");
77 $this->assertTrue(
true);
◆ testWrongRBGValue3()
ColorTest::testWrongRBGValue3 |
( |
| ) |
|
Definition at line 81 of file ColorTest.php.
84 $v = $this->f->color(array(1,1,
'123'));
85 $this->assertFalse(
"This should not happen.");
87 $this->assertTrue(
true);
◆ testWrongRBGValue4()
ColorTest::testWrongRBGValue4 |
( |
| ) |
|
Definition at line 91 of file ColorTest.php.
94 $v = $this->f->color(array());
95 $this->assertFalse(
"This should not happen.");
97 $this->assertTrue(
true);
The documentation for this class was generated from the following file: