mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-10 17:36:53 +00:00
Fix test assertions that did not verify the intended behavior
This commit is contained in:
@@ -111,6 +111,8 @@ final class CorrectnessNodeVisitor implements NodeVisitorInterface
|
||||
if ($node instanceof ModuleNode) {
|
||||
$this->rootNodes = null;
|
||||
$this->hasParent = false;
|
||||
|
||||
return $node;
|
||||
}
|
||||
if ($node instanceof BlockNode) {
|
||||
--$this->blockDepth;
|
||||
|
||||
@@ -45,8 +45,8 @@ class TextTest extends NodeTestCase
|
||||
*/
|
||||
public function testIsBlank($blank)
|
||||
{
|
||||
$this->isTrue((new TextNode($blank, 1))->isBlank());
|
||||
$this->isTrue((new TextNode(\chr(0xEF).\chr(0xBB).\chr(0xBF).$blank, 1))->isBlank());
|
||||
$this->assertTrue((new TextNode($blank, 1))->isBlank());
|
||||
$this->assertTrue((new TextNode(\chr(0xEF).\chr(0xBB).\chr(0xBF).$blank, 1))->isBlank());
|
||||
}
|
||||
|
||||
public static function getIsBlankData()
|
||||
|
||||
@@ -75,7 +75,9 @@ class CorrectnessTest extends TestCase
|
||||
{
|
||||
$input = new TextNode(\chr(0xEF).\chr(0xBB).\chr(0xBF).$emptyText, 1);
|
||||
|
||||
$this->assertCount(0, $this->traverse($input, new EmptyNode()));
|
||||
// a child template whose root content is only a BOM followed by blanks is valid:
|
||||
// the visitor must accept it (no SyntaxError) and leave it untouched
|
||||
$this->assertSame($input, $this->traverse($input, new EmptyNode()));
|
||||
}
|
||||
|
||||
public static function getFilterBodyNodesWithBOMData()
|
||||
|
||||
Reference in New Issue
Block a user