fixed a unit test when run in isolation
authorFabien Potencier <fabien.potencier@gmail.com>
Wed, 1 May 2013 18:28:29 +0000 (20:28 +0200)
committerFabien Potencier <fabien.potencier@gmail.com>
Wed, 1 May 2013 18:28:29 +0000 (20:28 +0200)
test/Twig/Tests/Extension/CoreTest.php

index 77a8101..5743e34 100644 (file)
@@ -16,8 +16,10 @@ class Twig_Tests_Extension_CoreTest extends PHPUnit_Framework_TestCase
      */
     public function testRandomFunction($value, $expectedInArray)
     {
+        $env = new Twig_Environment();
+
         for ($i = 0; $i < 100; $i++) {
-            $this->assertTrue(in_array(twig_random(new Twig_Environment(), $value), $expectedInArray, true)); // assertContains() would not consider the type
+            $this->assertTrue(in_array(twig_random($env, $value), $expectedInArray, true)); // assertContains() would not consider the type
         }
     }