Skip to content

Commit d708b18

Browse files
authored
Merge pull request #299 from villfa/test/298
Tests: add a case to cover issue #298
2 parents e4b1dd3 + 98e82e3 commit d708b18

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/unit/DocBlock/Tags/InvalidTagTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,19 @@ private function throwExceptionWithResourceArgument(): void
108108

109109
$function(fopen(__FILE__, 'r'));
110110
}
111+
112+
public function testCreationWithErrorFromEval(): void
113+
{
114+
$builder = static function (): InvalidArgumentException {
115+
return new InvalidArgumentException();
116+
};
117+
118+
$exception = eval('return $builder();');
119+
$tag = InvalidTag::create('Body', 'name')->withError($exception);
120+
121+
self::assertSame('name', $tag->getName());
122+
self::assertSame('@name Body', $tag->render());
123+
self::assertSame('Body', (string) $tag);
124+
self::assertSame($exception, $tag->getException());
125+
}
111126
}

0 commit comments

Comments
 (0)