1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
// override information about intl
namespace yiiunit\framework\i18n {
use yiiunit\TestCase;
class IntlTestHelper {
public static $enableIntl;
/**
* emulate disabled intl extension
*
* enable it only for tests prefixed with testIntl
* @param Testcase $test
*/
public static function setIntlStatus($test)
{
static::$enableIntl = null;
if (strncmp($test->getName(false), 'testIntl', 8) === 0) {
if (!extension_loaded('intl')) {
$test->markTestSkipped('intl extension is not installed.');
}
static::$enableIntl = true;
} else {
static::$enableIntl = false;
}
}
public static function resetIntlStatus()
{
static::$enableIntl = null;
}
}
}
namespace yii\i18n {
use yiiunit\framework\i18n\IntlTestHelper;
if (!function_exists('yii\i18n\extension_loaded')) {
function extension_loaded($name)
{
if ($name === 'intl' && IntlTestHelper::$enableIntl !== null) {
return IntlTestHelper::$enableIntl;
}
return \extension_loaded($name);
}
}
}
namespace yii\helpers {
use yiiunit\framework\i18n\IntlTestHelper;
if (!function_exists('yii\helpers\extension_loaded')) {
function extension_loaded($name)
{
if ($name === 'intl' && IntlTestHelper::$enableIntl !== null) {
return IntlTestHelper::$enableIntl;
}
return \extension_loaded($name);
}
}
}
namespace yii\validators {
use yiiunit\framework\i18n\IntlTestHelper;
if (!function_exists('yii\validators\extension_loaded')) {
function extension_loaded($name)
{
if ($name === 'intl' && IntlTestHelper::$enableIntl !== null) {
return IntlTestHelper::$enableIntl;
}
return \extension_loaded($name);
}
}
}