Skip to content

Commit bdcc0cf

Browse files
TomasVotrubajaapio
authored andcommitted
Serializer - add test for tag removal extra spaces
1 parent 6646577 commit bdcc0cf

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/unit/DocBlock/SerializerTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,33 @@ public function testWordwrapsAroundTheGivenAmountOfCharacters()
172172
$this->assertSame($expected, $fixture->getDocComment($docBlock));
173173
}
174174

175+
/**
176+
* @covers ::__construct
177+
* @covers ::getDocComment
178+
*/
179+
public function testNoExtraSpacesAfterTagRemoval()
180+
{
181+
$expected = <<<'DOCCOMMENT'
182+
/**
183+
* @unknown-tag
184+
*/
185+
DOCCOMMENT;
186+
187+
$expectedAfterRemove = <<<'DOCCOMMENT_AFTER_REMOVE'
188+
/**
189+
*/
190+
DOCCOMMENT_AFTER_REMOVE;
191+
192+
$fixture = new Serializer(0, '', true, 15);
193+
$genericTag = new DocBlock\Tags\Generic('unknown-tag');
194+
195+
$docBlock = new DocBlock('',null, [$genericTag]);
196+
$this->assertSame($expected, $fixture->getDocComment($docBlock));
197+
198+
$docBlock->removeTag($genericTag);
199+
$this->assertSame($expectedAfterRemove, $fixture->getDocComment($docBlock));
200+
}
201+
175202
/**
176203
* @covers ::__construct
177204
* @expectedException \InvalidArgumentException

0 commit comments

Comments
 (0)