/** * @dataProvider colorData */ public function testColorData($color, $expectedResult) { echo "colordata"; $rule = new JFormRuleColor(); $xml = simplexml_load_string('<form><field name="color1" /></form>', 'JXMLElement'); $this->assertThat($rule->test($xml->field[0], $color), $this->equalTo($expectedResult), $color . ' should have returned ' . ($expectedResult ? 'true' : 'false') . ' but did not'); }
/** * @testdox The color rule passes values that are valid hexadecimal color codes * * @param mixed $value The value to test * * @dataProvider casesRuleSuccess */ public function testRuleSuccess($value) { $rule = new JFormRuleColor(); $this->assertTrue($rule->test(new SimpleXMLElement('<form><field name="color" /></form>'), $value)); }