@@ -109,6 +109,22 @@ public function testDescriptionCanParseAStringWithInlineTag(): void
109109 * @covers ::__construct
110110 * @covers ::create
111111 */
112+ public function testDescriptionCanParseAStringStartingWithInlineTag (): void
113+ {
114+ $ contents = '{@link http://phpdoc.org/ This} is text for a description that starts with an inline tag. ' ;
115+ $ context = new Context ('' );
116+ $ tagFactory = m::mock (TagFactory::class);
117+ $ tagFactory ->shouldReceive ('create ' )
118+ ->once ()
119+ ->with ('@link http://phpdoc.org/ This ' , $ context )
120+ ->andReturn (new LinkTag ('http://phpdoc.org/ ' , new Description ('This ' )));
121+
122+ $ factory = new DescriptionFactory ($ tagFactory );
123+ $ description = $ factory ->create ($ contents , $ context );
124+
125+ $ this ->assertSame ($ contents , $ description ->render ());
126+ }
127+
112128 /**
113129 * @uses \phpDocumentor\Reflection\DocBlock\Description
114130 * @uses \phpDocumentor\Reflection\DocBlock\Tags\Link
@@ -136,22 +152,6 @@ public function testDescriptionCanParseStringWithInlineTagContainingBalancedBrac
136152 $ this ->assertSame ('This description has a %1$s in it. ' , $ description ->getBodyTemplate ());
137153 }
138154
139- public function testDescriptionCanParseAStringStartingWithInlineTag (): void
140- {
141- $ contents = '{@link http://phpdoc.org/ This} is text for a description that starts with an inline tag. ' ;
142- $ context = new Context ('' );
143- $ tagFactory = m::mock (TagFactory::class);
144- $ tagFactory ->shouldReceive ('create ' )
145- ->once ()
146- ->with ('@link http://phpdoc.org/ This ' , $ context )
147- ->andReturn (new LinkTag ('http://phpdoc.org/ ' , new Description ('This ' )));
148-
149- $ factory = new DescriptionFactory ($ tagFactory );
150- $ description = $ factory ->create ($ contents , $ context );
151-
152- $ this ->assertSame ($ contents , $ description ->render ());
153- }
154-
155155 /**
156156 * @uses \phpDocumentor\Reflection\DocBlock\Description
157157 * @uses \phpDocumentor\Reflection\DocBlock\Tags\Link
0 commit comments