Serializer - add test for tag removal extra spaces

This commit is contained in:
TomasVotruba
2017-11-30 08:14:17 +01:00
committed by Jaap van Otterdijk
parent 66465776cf
commit bdcc0cff11
+27
View File
@@ -172,6 +172,33 @@ DOCCOMMENT;
$this->assertSame($expected, $fixture->getDocComment($docBlock)); $this->assertSame($expected, $fixture->getDocComment($docBlock));
} }
/**
* @covers ::__construct
* @covers ::getDocComment
*/
public function testNoExtraSpacesAfterTagRemoval()
{
$expected = <<<'DOCCOMMENT'
/**
* @unknown-tag
*/
DOCCOMMENT;
$expectedAfterRemove = <<<'DOCCOMMENT_AFTER_REMOVE'
/**
*/
DOCCOMMENT_AFTER_REMOVE;
$fixture = new Serializer(0, '', true, 15);
$genericTag = new DocBlock\Tags\Generic('unknown-tag');
$docBlock = new DocBlock('',null, [$genericTag]);
$this->assertSame($expected, $fixture->getDocComment($docBlock));
$docBlock->removeTag($genericTag);
$this->assertSame($expectedAfterRemove, $fixture->getDocComment($docBlock));
}
/** /**
* @covers ::__construct * @covers ::__construct
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException