mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 22:32:40 +08:00
Raise version min PHP 7.3.
This commit is contained in:
@ -40,7 +40,7 @@ use yiiunit\TestCase;
|
||||
*/
|
||||
class ContainerTest extends TestCase
|
||||
{
|
||||
protected function tearDown()
|
||||
protected function tearDown(): void
|
||||
{
|
||||
parent::tearDown();
|
||||
Yii::$container = new Container();
|
||||
@ -443,11 +443,10 @@ class ContainerTest extends TestCase
|
||||
$this->assertSame(42, $qux->a);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \yii\base\InvalidConfigException
|
||||
*/
|
||||
public function testThrowingNotFoundException()
|
||||
{
|
||||
$this->expectException(\yii\di\NotInstantiableException::class);
|
||||
|
||||
$container = new Container();
|
||||
$container->get('non_existing');
|
||||
}
|
||||
@ -480,36 +479,13 @@ class ContainerTest extends TestCase
|
||||
$this->assertSame($foo, $sameFoo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @requires PHP 5.6
|
||||
*/
|
||||
public function testVariadicConstructor()
|
||||
{
|
||||
if (\defined('HHVM_VERSION')) {
|
||||
static::markTestSkipped('Can not test on HHVM because it does not support variadics.');
|
||||
}
|
||||
|
||||
$container = new Container();
|
||||
$container->get('yiiunit\framework\di\stubs\Variadic');
|
||||
}
|
||||
|
||||
/**
|
||||
* @requires PHP 5.6
|
||||
*/
|
||||
public function testVariadicCallable()
|
||||
{
|
||||
if (\defined('HHVM_VERSION')) {
|
||||
static::markTestSkipped('Can not test on HHVM because it does not support variadics.');
|
||||
}
|
||||
|
||||
require __DIR__ . '/testContainerWithVariadicCallable.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://github.com/yiisoft/yii2/issues/18245
|
||||
*/
|
||||
public function testDelayedInitializationOfSubArray()
|
||||
{
|
||||
$this->expectNotToPerformAssertions();
|
||||
|
||||
$definitions = [
|
||||
'test' => [
|
||||
'class' => Corge::className(),
|
||||
@ -610,11 +586,6 @@ class ContainerTest extends TestCase
|
||||
|
||||
public function testNullTypeConstructorParameters()
|
||||
{
|
||||
if (PHP_VERSION_ID < 70100) {
|
||||
$this->markTestSkipped('Can not be tested on PHP < 7.1');
|
||||
return;
|
||||
}
|
||||
|
||||
$zeta = (new Container())->get(Zeta::className());
|
||||
$this->assertInstanceOf(Beta::className(), $zeta->beta);
|
||||
$this->assertInstanceOf(Beta::className(), $zeta->betaNull);
|
||||
|
||||
Reference in New Issue
Block a user