mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 11:56:50 +00:00
made some minor tweaks to PHPUnit assertions
This commit is contained in:
@@ -20,7 +20,7 @@ class Twig_Tests_Node_AutoEscapeTest extends Twig_Test_NodeTestCase
|
||||
$node = new Twig_Node_AutoEscape(true, $body, 1);
|
||||
|
||||
$this->assertEquals($body, $node->getNode('body'));
|
||||
$this->assertEquals(true, $node->getAttribute('value'));
|
||||
$this->assertTrue($node->getAttribute('value'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,7 +31,7 @@ class Twig_Tests_Node_ForTest extends Twig_Test_NodeTestCase
|
||||
$this->assertTrue($node->getAttribute('ifexpr'));
|
||||
$this->assertEquals('Twig_Node_If', get_class($node->getNode('body')));
|
||||
$this->assertEquals($body, $node->getNode('body')->getNode('tests')->getNode(1)->getNode(0));
|
||||
$this->assertEquals(null, $node->getNode('else'));
|
||||
$this->assertNull($node->getNode('else'));
|
||||
|
||||
$else = new Twig_Node_Print(new Twig_Node_Expression_Name('foo', 1), 1);
|
||||
$node = new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1);
|
||||
|
||||
@@ -24,7 +24,7 @@ class Twig_Tests_Node_IfTest extends Twig_Test_NodeTestCase
|
||||
$node = new Twig_Node_If($t, $else, 1);
|
||||
|
||||
$this->assertEquals($t, $node->getNode('tests'));
|
||||
$this->assertEquals(null, $node->getNode('else'));
|
||||
$this->assertNull($node->getNode('else'));
|
||||
|
||||
$else = new Twig_Node_Print(new Twig_Node_Expression_Name('bar', 1), 1);
|
||||
$node = new Twig_Node_If($t, $else, 1);
|
||||
|
||||
@@ -19,7 +19,7 @@ class Twig_Tests_Node_IncludeTest extends Twig_Test_NodeTestCase
|
||||
$expr = new Twig_Node_Expression_Constant('foo.twig', 1);
|
||||
$node = new Twig_Node_Include($expr, null, false, false, 1);
|
||||
|
||||
$this->assertEquals(null, $node->getNode('variables'));
|
||||
$this->assertNull($node->getNode('variables'));
|
||||
$this->assertEquals($expr, $node->getNode('expr'));
|
||||
$this->assertFalse($node->getAttribute('only'));
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class Twig_Tests_Node_SetTest extends Twig_Test_NodeTestCase
|
||||
|
||||
$this->assertEquals($names, $node->getNode('names'));
|
||||
$this->assertEquals($values, $node->getNode('values'));
|
||||
$this->assertEquals(false, $node->getAttribute('capture'));
|
||||
$this->assertFalse($node->getAttribute('capture'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -112,7 +112,7 @@ class Twig_Tests_ParserTest extends PHPUnit_Framework_TestCase
|
||||
new Twig_Token(Twig_Token::EOF_TYPE, '', 1),
|
||||
)));
|
||||
|
||||
$this->assertEquals(null, $parser->getParent());
|
||||
$this->assertNull($parser->getParent());
|
||||
}
|
||||
|
||||
// The getVarName() must not depend on the template loaders,
|
||||
|
||||
@@ -245,7 +245,7 @@ class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
$object = new Twig_TemplateMagicMethodExceptionObject();
|
||||
|
||||
$this->assertEquals(null, $template->getAttribute($object, 'foo'));
|
||||
$this->assertNull($template->getAttribute($object, 'foo'));
|
||||
}
|
||||
|
||||
public function getGetAttributeTests()
|
||||
|
||||
Reference in New Issue
Block a user