From 9ec7e766fb01e5671a122ccb17dd23e36a52c159 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 1 May 2013 20:28:29 +0200 Subject: [PATCH] fixed a unit test when run in isolation --- test/Twig/Tests/Extension/CoreTest.php | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) 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 } } -- 1.7.2.5