@@ -122,6 +122,37 @@ public function testDescriptionCanParseAStringStartingWithInlineTag() : void
122122 $ this ->assertSame ($ contents , $ description ->render ());
123123 }
124124
125+ /**
126+ * @uses \phpDocumentor\Reflection\DocBlock\Description
127+ * @uses \phpDocumentor\Reflection\DocBlock\Tags\Link
128+ * @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag
129+ * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter
130+ * @uses \phpDocumentor\Reflection\Types\Context
131+ *
132+ * @covers ::__construct
133+ * @covers ::create
134+ */
135+ public function testDescriptionCanParseAStringContainingMultipleTags () : void
136+ {
137+ $ contents = 'This description has a {@link http://phpdoc.org/ This} another {@link http://phpdoc.org/ This2} ' ;
138+ $ context = new Context ('' );
139+ $ tagFactory = m::mock (TagFactory::class);
140+ $ tagFactory ->shouldReceive ('create ' )
141+ ->twice ()
142+ ->andReturnValues (
143+ [
144+ new LinkTag ('http://phpdoc.org/ ' , new Description ('This ' )),
145+ new LinkTag ('http://phpdoc.org/ ' , new Description ('This2 ' )),
146+ ]
147+ );
148+
149+ $ factory = new DescriptionFactory ($ tagFactory );
150+ $ description = $ factory ->create ($ contents , $ context );
151+
152+ $ this ->assertSame ($ contents , $ description ->render ());
153+ $ this ->assertSame ('This description has a %1$s another %2$s ' , $ description ->getBodyTemplate ());
154+ }
155+
125156 /**
126157 * @uses \phpDocumentor\Reflection\DocBlock\Description
127158 *
0 commit comments