Skip to content

Commit d0b40ce

Browse files
committed
Issue #62 Use a custom constant instead of YII_ENV_TEST during tests
1 parent ad0bd31 commit d0b40ce

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

UrlManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ protected function redirectToLanguage($language)
432432
}
433433
Yii::trace("Redirecting to $url.", __METHOD__);
434434
Yii::$app->getResponse()->redirect($url);
435-
if (YII_ENV_TEST) {
435+
if (YII2_LOCALEURLS_TEST) {
436436
// Response::redirect($url) above will call `Url::to()` internally. So to really
437437
// test for the same final redirect URL here, we need to call Url::to(), too.
438438
throw new \yii\base\Exception(\yii\helpers\Url::to($url));

tests/bootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
define('YII_DEBUG', true);
77
define('YII_ENV_TEST', true);
8+
define('YII2_LOCALEURLS_TEST', true);
89
// require composer autoloader if available
910
require(__DIR__ . '/../vendor/autoload.php');
1011
require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');

0 commit comments

Comments
 (0)