From 4478816e41d30de147e6dfb684af005e3050234a Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 6 Feb 2012 18:16:12 +0100 Subject: [PATCH] removed usage of assertInstanceOf as if is not available when using PHPUnit on PHP 5.2.* --- test/Twig/Tests/Node/ForTest.php | 2 +- test/Twig/Tests/NodeVisitor/OptimizerTest.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/Twig/Tests/Node/ForTest.php b/test/Twig/Tests/Node/ForTest.php index f57d23a..ef3be82 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_Tests_Node_TestCase $this->assertEquals($valueTarget, $node->getNode('value_target')); $this->assertEquals($seq, $node->getNode('seq')); $this->assertTrue($node->getAttribute('ifexpr')); - $this->assertInstanceOf('Twig_Node_If', $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(null, $node->getNode('else')); diff --git a/test/Twig/Tests/NodeVisitor/OptimizerTest.php b/test/Twig/Tests/NodeVisitor/OptimizerTest.php index 94a4cfa..a55d98e 100644 --- a/test/Twig/Tests/NodeVisitor/OptimizerTest.php +++ b/test/Twig/Tests/NodeVisitor/OptimizerTest.php @@ -19,7 +19,7 @@ class Twig_Tests_NodeVisitor_OptimizerTest extends PHPUnit_Framework_TestCase $node = $stream->getNode('body')->getNode(0); - $this->assertInstanceOf('Twig_Node_Expression_BlockReference', $node); + $this->assertEquals('Twig_Node_Expression_BlockReference', get_class($node)); $this->assertTrue($node->getAttribute('output')); } @@ -32,7 +32,7 @@ class Twig_Tests_NodeVisitor_OptimizerTest extends PHPUnit_Framework_TestCase $node = $stream->getNode('blocks')->getNode('content')->getNode(0)->getNode('body'); - $this->assertInstanceOf('Twig_Node_Expression_Parent', $node); + $this->assertEquals('Twig_Node_Expression_Parent', get_class($node)); $this->assertTrue($node->getAttribute('output')); } @@ -48,7 +48,7 @@ class Twig_Tests_NodeVisitor_OptimizerTest extends PHPUnit_Framework_TestCase $node = $stream->getNode('body')->getNode(0)->getNode(1); - $this->assertInstanceOf('Twig_Node_Expression_BlockReference', $node); + $this->assertEquals('Twig_Node_Expression_BlockReference', get_class($node)); $this->assertTrue($node->getAttribute('output')); } -- 1.7.2.5