Skip to content

Commit 82566dc

Browse files
committed
Add Regexp tests
1 parent dc5e6bc commit 82566dc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/Faker/Provider/ColorTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ public function testRgbCssColor()
3434
$this->assertRegExp('/^rgb\(' . $regexp . ',' . $regexp . ',' . $regexp . '\)$/i', Color::rgbCssColor());
3535
}
3636

37+
public function testRgbaCssColor()
38+
{
39+
$regexp = '([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])';
40+
$regexpAlpha = '([01]?\.[0-9])';
41+
$this->assertRegExp('/^rgba\(' . $regexp . ',' . $regexp . ',' . $regexp . ',' . $regexpAlpha . '\)$/i', Color::rgbaCssColor());
42+
}
43+
3744
public function testSafeColorName()
3845
{
3946
$this->assertRegExp('/^[\w]+$/', Color::safeColorName());

0 commit comments

Comments
 (0)