public function Twig_Tests_Extension_CoreTest::testRandomFunction in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php \Twig_Tests_Extension_CoreTest::testRandomFunction()
@dataProvider getRandomFunctionTestData
File
- vendor/
twig/ twig/ test/ Twig/ Tests/ Extension/ CoreTest.php, line 17
Class
Code
public function testRandomFunction($value, $expectedInArray) {
$env = new Twig_Environment($this
->getMock('Twig_LoaderInterface'));
for ($i = 0; $i < 100; ++$i) {
$this
->assertTrue(in_array(twig_random($env, $value), $expectedInArray, true));
// assertContains() would not consider the type
}
}