diff --git a/tests/unit/TestCase.php b/tests/unit/TestCase.php index 88071c3f83..787b1e04b2 100644 --- a/tests/unit/TestCase.php +++ b/tests/unit/TestCase.php @@ -1,6 +1,7 @@ mockApplication([], '\yii\web\Application'); + $config = [ + 'components' => [ + 'request' => [ + 'hostInfo' => 'http://testdomain.com', + 'scriptUrl' => '/index.php', + ], + ] + ]; + $this->mockApplication($config, '\yii\web\Application'); } /** @@ -106,4 +114,4 @@ class OAuth1Test extends TestCase $this->assertContains($authUrl, $builtAuthUrl, 'No auth URL present!'); $this->assertContains($requestTokenToken, $builtAuthUrl, 'No token present!'); } -} \ No newline at end of file +} diff --git a/tests/unit/extensions/authclient/OAuth2Test.php b/tests/unit/extensions/authclient/OAuth2Test.php index 69721cd847..8542eb4659 100644 --- a/tests/unit/extensions/authclient/OAuth2Test.php +++ b/tests/unit/extensions/authclient/OAuth2Test.php @@ -9,7 +9,15 @@ class OAuth2Test extends TestCase { protected function setUp() { - $this->mockApplication([], '\yii\web\Application'); + $config = [ + 'components' => [ + 'request' => [ + 'hostInfo' => 'http://testdomain.com', + 'scriptUrl' => '/index.php', + ], + ] + ]; + $this->mockApplication($config, '\yii\web\Application'); } // Tests : @@ -30,4 +38,4 @@ class OAuth2Test extends TestCase $this->assertContains($clientId, $builtAuthUrl, 'No client id present!'); $this->assertContains(rawurlencode($returnUrl), $builtAuthUrl, 'No return URL present!'); } -} \ No newline at end of file +}