mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-17 17:47:13 +00:00
Tests: add a case to cover issue #298
This commit is contained in:
@@ -108,4 +108,19 @@ final class InvalidTagTest extends TestCase
|
||||
|
||||
$function(fopen(__FILE__, 'r'));
|
||||
}
|
||||
|
||||
public function testCreationWithErrorFromEval(): void
|
||||
{
|
||||
$builder = static function (): InvalidArgumentException {
|
||||
return new InvalidArgumentException();
|
||||
};
|
||||
|
||||
$exception = eval('return $builder();');
|
||||
$tag = InvalidTag::create('Body', 'name')->withError($exception);
|
||||
|
||||
self::assertSame('name', $tag->getName());
|
||||
self::assertSame('@name Body', $tag->render());
|
||||
self::assertSame('Body', (string) $tag);
|
||||
self::assertSame($exception, $tag->getException());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user