From: Fabien Potencier Date: Sun, 5 Jan 2014 16:24:50 +0000 (+0100) Subject: made some minor tweaks to PHPUnit assertions X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=e5e2a01051cfaa6e58e9fdad56ae108a1dcac2c8;p=web%2Fkonrad%2Ftwig.git made some minor tweaks to PHPUnit assertions --- diff --git a/test/Twig/Tests/Node/AutoEscapeTest.php b/test/Twig/Tests/Node/AutoEscapeTest.php index 608446b..dc7ddc5 100644 --- a/test/Twig/Tests/Node/AutoEscapeTest.php +++ b/test/Twig/Tests/Node/AutoEscapeTest.php @@ -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')); } /** diff --git a/test/Twig/Tests/Node/ForTest.php b/test/Twig/Tests/Node/ForTest.php index 21cc84e..09862a7 100644 --- a/test/Twig/Tests/Node/ForTest.php +++ b/test/Twig/Tests/Node/ForTest.php @@ -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); diff --git a/test/Twig/Tests/Node/IfTest.php b/test/Twig/Tests/Node/IfTest.php index 92fc29d..2d96f6f 100644 --- a/test/Twig/Tests/Node/IfTest.php +++ b/test/Twig/Tests/Node/IfTest.php @@ -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); diff --git a/test/Twig/Tests/Node/IncludeTest.php b/test/Twig/Tests/Node/IncludeTest.php index 3b7da6e..e8aa326 100644 --- a/test/Twig/Tests/Node/IncludeTest.php +++ b/test/Twig/Tests/Node/IncludeTest.php @@ -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')); diff --git a/test/Twig/Tests/Node/SetTest.php b/test/Twig/Tests/Node/SetTest.php index d64d671..893cd4d 100644 --- a/test/Twig/Tests/Node/SetTest.php +++ b/test/Twig/Tests/Node/SetTest.php @@ -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')); } /** diff --git a/test/Twig/Tests/ParserTest.php b/test/Twig/Tests/ParserTest.php index 55eb7fb..b4a3abb 100644 --- a/test/Twig/Tests/ParserTest.php +++ b/test/Twig/Tests/ParserTest.php @@ -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, diff --git a/test/Twig/Tests/TemplateTest.php b/test/Twig/Tests/TemplateTest.php index 25c7a4a..c3f2463 100644 --- a/test/Twig/Tests/TemplateTest.php +++ b/test/Twig/Tests/TemplateTest.php @@ -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()