made some minor tweaks to PHPUnit assertions

This commit is contained in:
Fabien Potencier
2014-01-05 17:24:50 +01:00
parent f3f5f0aba7
commit e5e2a01051
7 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ class Twig_Tests_Node_AutoEscapeTest extends Twig_Test_NodeTestCase
$node = new Twig_Node_AutoEscape(true, $body, 1); $node = new Twig_Node_AutoEscape(true, $body, 1);
$this->assertEquals($body, $node->getNode('body')); $this->assertEquals($body, $node->getNode('body'));
$this->assertEquals(true, $node->getAttribute('value')); $this->assertTrue($node->getAttribute('value'));
} }
/** /**
+1 -1
View File
@@ -31,7 +31,7 @@ class Twig_Tests_Node_ForTest extends Twig_Test_NodeTestCase
$this->assertTrue($node->getAttribute('ifexpr')); $this->assertTrue($node->getAttribute('ifexpr'));
$this->assertEquals('Twig_Node_If', get_class($node->getNode('body'))); $this->assertEquals('Twig_Node_If', get_class($node->getNode('body')));
$this->assertEquals($body, $node->getNode('body')->getNode('tests')->getNode(1)->getNode(0)); $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); $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); $node = new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, 1);
+1 -1
View File
@@ -24,7 +24,7 @@ class Twig_Tests_Node_IfTest extends Twig_Test_NodeTestCase
$node = new Twig_Node_If($t, $else, 1); $node = new Twig_Node_If($t, $else, 1);
$this->assertEquals($t, $node->getNode('tests')); $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); $else = new Twig_Node_Print(new Twig_Node_Expression_Name('bar', 1), 1);
$node = new Twig_Node_If($t, $else, 1); $node = new Twig_Node_If($t, $else, 1);
+1 -1
View File
@@ -19,7 +19,7 @@ class Twig_Tests_Node_IncludeTest extends Twig_Test_NodeTestCase
$expr = new Twig_Node_Expression_Constant('foo.twig', 1); $expr = new Twig_Node_Expression_Constant('foo.twig', 1);
$node = new Twig_Node_Include($expr, null, false, false, 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->assertEquals($expr, $node->getNode('expr'));
$this->assertFalse($node->getAttribute('only')); $this->assertFalse($node->getAttribute('only'));
+1 -1
View File
@@ -22,7 +22,7 @@ class Twig_Tests_Node_SetTest extends Twig_Test_NodeTestCase
$this->assertEquals($names, $node->getNode('names')); $this->assertEquals($names, $node->getNode('names'));
$this->assertEquals($values, $node->getNode('values')); $this->assertEquals($values, $node->getNode('values'));
$this->assertEquals(false, $node->getAttribute('capture')); $this->assertFalse($node->getAttribute('capture'));
} }
/** /**
+1 -1
View File
@@ -112,7 +112,7 @@ class Twig_Tests_ParserTest extends PHPUnit_Framework_TestCase
new Twig_Token(Twig_Token::EOF_TYPE, '', 1), 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, // The getVarName() must not depend on the template loaders,
+1 -1
View File
@@ -245,7 +245,7 @@ class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase
$object = new Twig_TemplateMagicMethodExceptionObject(); $object = new Twig_TemplateMagicMethodExceptionObject();
$this->assertEquals(null, $template->getAttribute($object, 'foo')); $this->assertNull($template->getAttribute($object, 'foo'));
} }
public function getGetAttributeTests() public function getGetAttributeTests()