mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-14 06:11:35 +08:00
fixed test break.
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace yiiunit;
|
||||
use yii\helpers\ArrayHelper;
|
||||
|
||||
/**
|
||||
* This is the base class for all yii framework unit tests.
|
||||
@ -47,7 +48,7 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase
|
||||
];
|
||||
$defaultConfig['vendorPath'] = dirname(dirname(__DIR__)) . '/vendor';
|
||||
|
||||
new $appClass(array_merge($defaultConfig, $config));
|
||||
new $appClass(ArrayHelper::merge($defaultConfig, $config));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -11,7 +11,15 @@ class OAuth1Test 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');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,4 +114,4 @@ class OAuth1Test extends TestCase
|
||||
$this->assertContains($authUrl, $builtAuthUrl, 'No auth URL present!');
|
||||
$this->assertContains($requestTokenToken, $builtAuthUrl, 'No token present!');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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!');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user