public static getDataFromTestWithAnnotation ( string $docComment ) : array | ||
$docComment | string | full docComment string |
return | array | when @testWith annotation is defined null when @testWith annotation is omitted |
/** * @covers PHPUnit_Util_Test::getDataFromTestWithAnnotation */ public function testTestWithThrowsProperExceptionIfDatasetCannotBeParsed() { $this->setExpectedExceptionRegExp('PHPUnit_Framework_Exception', '/^The dataset for the @testWith annotation cannot be parsed.$/'); PHPUnit_Util_Test::getDataFromTestWithAnnotation('/** * @testWith [s] */'); }
public function testTestWithThrowsProperExceptionIfMultiLineDatasetCannotBeParsed() { $this->expectException(PHPUnit_Framework_Exception::class); $this->expectExceptionMessageRegExp('/^The dataset for the @testWith annotation cannot be parsed:/'); PHPUnit_Util_Test::getDataFromTestWithAnnotation('/** * @testWith ["valid"] * [invalid] */'); }