mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 21:41:19 +08:00
Raise version min PHP 7.3.
This commit is contained in:
@ -21,7 +21,7 @@ use yiiunit\TestCase;
|
||||
*/
|
||||
class InstanceTest extends TestCase
|
||||
{
|
||||
protected function tearDown()
|
||||
protected function tearDown(): void
|
||||
{
|
||||
parent::tearDown();
|
||||
Yii::$container = new Container();
|
||||
@ -59,7 +59,7 @@ class InstanceTest extends TestCase
|
||||
{
|
||||
$container = new Container();
|
||||
$this->expectException('yii\base\InvalidConfigException');
|
||||
$this->expectExceptionMessageRegExp('/^Failed to instantiate component or class/i');
|
||||
$this->expectExceptionMessageMatches('/^Failed to instantiate component or class/i');
|
||||
Instance::ensure('cache', 'yii\cache\Cache', $container);
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ class InstanceTest extends TestCase
|
||||
{
|
||||
$container = new Container();
|
||||
$this->expectException('yii\base\InvalidConfigException');
|
||||
$this->expectExceptionMessageRegExp('/^Failed to instantiate component or class/i');
|
||||
$this->expectExceptionMessageMatches('/^Failed to instantiate component or class/i');
|
||||
Instance::ensure('yii\cache\DoesNotExist', 'yii\cache\Cache', $container);
|
||||
}
|
||||
|
||||
@ -171,7 +171,10 @@ class InstanceTest extends TestCase
|
||||
$instance = Instance::of('something');
|
||||
$export = var_export($instance, true);
|
||||
|
||||
$this->assertRegExp('~yii\\\\di\\\\Instance::__set_state\(array\(\s+\'id\' => \'something\',\s+\'optional\' => false,\s+\)\)~', $export);
|
||||
$this->assertMatchesRegularExpression(
|
||||
'~yii\\\\di\\\\Instance::__set_state\(array\(\s+\'id\' => \'something\',\s+\'optional\' => false,\s+\)\)~',
|
||||
$export
|
||||
);
|
||||
|
||||
$this->assertEquals($instance, Instance::__set_state([
|
||||
'id' => 'something',
|
||||
|
||||
Reference in New Issue
Block a user