made some minor tweaks to PHPUnit assertions
authorFabien Potencier <fabien.potencier@gmail.com>
Sun, 5 Jan 2014 16:24:50 +0000 (17:24 +0100)
committerFabien Potencier <fabien.potencier@gmail.com>
Sun, 5 Jan 2014 16:26:18 +0000 (17:26 +0100)
test/Twig/Tests/Node/AutoEscapeTest.php
test/Twig/Tests/Node/ForTest.php
test/Twig/Tests/Node/IfTest.php
test/Twig/Tests/Node/IncludeTest.php
test/Twig/Tests/Node/SetTest.php
test/Twig/Tests/ParserTest.php
test/Twig/Tests/TemplateTest.php

index 608446b..dc7ddc5 100644 (file)
@@ -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'));
     }
 
     /**
index 21cc84e..09862a7 100644 (file)
@@ -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);
index 92fc29d..2d96f6f 100644 (file)
@@ -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);
index 3b7da6e..e8aa326 100644 (file)
@@ -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'));
 
index d64d671..893cd4d 100644 (file)
@@ -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'));
     }
 
     /**
index 55eb7fb..b4a3abb 100644 (file)
@@ -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,
index 25c7a4a..c3f2463 100644 (file)
@@ -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()