From: Fabien Potencier Date: Wed, 1 May 2013 18:28:29 +0000 (+0200) Subject: fixed a unit test when run in isolation X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=9ec7e766fb01e5671a122ccb17dd23e36a52c159;p=web%2Fkonrad%2Ftwig.git fixed a unit test when run in isolation --- diff --git a/test/Twig/Tests/Extension/CoreTest.php b/test/Twig/Tests/Extension/CoreTest.php index 77a8101..5743e34 100644 --- a/test/Twig/Tests/Extension/CoreTest.php +++ b/test/Twig/Tests/Extension/CoreTest.php @@ -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 } }