diff --git a/tests/data/ar/Order.php b/tests/data/ar/Order.php index 99b61ca..bff235f 100644 --- a/tests/data/ar/Order.php +++ b/tests/data/ar/Order.php @@ -180,7 +180,7 @@ class Order extends ActiveRecord public function getLimitedItems() { - return $this->hasMany(Item::className(), ['id' => 'item_id']) + return $this->hasMany(Item::class, ['id' => 'item_id']) ->onCondition(['item.id' => [3, 5]]) ->via('orderItems'); } diff --git a/tests/framework/base/ApplicationTest.php b/tests/framework/base/ApplicationTest.php index 37fc67e..9e9b24a 100644 --- a/tests/framework/base/ApplicationTest.php +++ b/tests/framework/base/ApplicationTest.php @@ -19,13 +19,13 @@ class ApplicationTest extends TestCase $this->mockApplication([ 'container' => [ 'definitions' => [ - Dispatcher::className() => DispatcherMock::className() + Dispatcher::class => DispatcherMock::class ] ], 'bootstrap' => ['log'] ]); - $this->assertInstanceOf(DispatcherMock::className(), Yii::$app->log); + $this->assertInstanceOf(DispatcherMock::class, Yii::$app->log); } } diff --git a/tests/framework/db/ActiveQueryTest.php b/tests/framework/db/ActiveQueryTest.php index 777529c..7a0d860 100644 --- a/tests/framework/db/ActiveQueryTest.php +++ b/tests/framework/db/ActiveQueryTest.php @@ -134,7 +134,7 @@ abstract class ActiveQueryTest extends DatabaseTestCase */ public function testGetQueryTableName_from_not_set() { - $query = new ActiveQuery(Customer::className()); + $query = new ActiveQuery(Customer::class); $result = $this->invokeMethod($query,'getTableNameAndAlias'); $this->assertEquals(['customer','customer'], $result); } @@ -142,7 +142,7 @@ abstract class ActiveQueryTest extends DatabaseTestCase public function testGetQueryTableName_from_set() { $options = ['from' => ['alias'=>'customer']]; - $query = new ActiveQuery(Customer::className(),$options); + $query = new ActiveQuery(Customer::class,$options); $result = $this->invokeMethod($query,'getTableNameAndAlias'); $this->assertEquals(['customer','alias'], $result); } diff --git a/tests/framework/db/ActiveRecordTest.php b/tests/framework/db/ActiveRecordTest.php index f3c4e32..26d9f0c 100644 --- a/tests/framework/db/ActiveRecordTest.php +++ b/tests/framework/db/ActiveRecordTest.php @@ -55,7 +55,7 @@ abstract class ActiveRecordTest extends DatabaseTestCase public function getCategoryClass() { - return Category::className(); + return Category::class; } public function getOrderWithNullFKClass() diff --git a/tests/framework/di/ContainerTest.php b/tests/framework/di/ContainerTest.php index c0cd5e9..c138e19 100644 --- a/tests/framework/di/ContainerTest.php +++ b/tests/framework/di/ContainerTest.php @@ -231,8 +231,8 @@ class ContainerTest extends TestCase { $container = new Container(); $container->setDefinitions([ - 'model.order' => Order::className(), - Cat::className() => Type::className(), + 'model.order' => Order::class, + Cat::class => Type::class, 'test\TraversableInterface' => [ ['class' => 'yiiunit\data\base\TraversableObject'], [['item1', 'item2']] @@ -243,8 +243,8 @@ class ContainerTest extends TestCase ]); $container->setDefinitions([]); - $this->assertInstanceOf(Order::className(), $container->get('model.order')); - $this->assertInstanceOf(Type::className(), $container->get(Cat::className())); + $this->assertInstanceOf(Order::class, $container->get('model.order')); + $this->assertInstanceOf(Type::class, $container->get(Cat::class)); $traversable = $container->get('test\TraversableInterface'); $this->assertInstanceOf('yiiunit\data\base\TraversableObject', $traversable); @@ -257,7 +257,7 @@ class ContainerTest extends TestCase { $container = new Container(); $container->setSingletons([ - 'model.order' => Order::className(), + 'model.order' => Order::class, 'test\TraversableInterface' => [ ['class' => 'yiiunit\data\base\TraversableObject'], [['item1', 'item2']] diff --git a/tests/framework/filters/PageCacheTest.php b/tests/framework/filters/PageCacheTest.php index c23a797..839cd59 100644 --- a/tests/framework/filters/PageCacheTest.php +++ b/tests/framework/filters/PageCacheTest.php @@ -403,7 +403,7 @@ class PageCacheTest extends TestCase 'cache' => $cache = new ArrayCache(), 'view' => new View(), 'dependency' => [ - 'class' => ExpressionDependency::className(), + 'class' => ExpressionDependency::class, 'expression' => 'Yii::$app->params[\'dependency\']', ] ]); diff --git a/tests/framework/grid/RadiobuttonColumnTest.php b/tests/framework/grid/RadiobuttonColumnTest.php index c247bf4..e4ec791 100644 --- a/tests/framework/grid/RadiobuttonColumnTest.php +++ b/tests/framework/grid/RadiobuttonColumnTest.php @@ -76,7 +76,7 @@ class RadiobuttonColumnTest extends TestCase 'options' => ['id' => 'radio-gridview'], 'columns' => [ [ - 'class' => RadioButtonColumn::className(), + 'class' => RadioButtonColumn::class, 'radioOptions' => function ($model) { return [ 'value' => $model['value'], diff --git a/tests/framework/validators/ValidatorTest.php b/tests/framework/validators/ValidatorTest.php index 5556249..912fbb1 100644 --- a/tests/framework/validators/ValidatorTest.php +++ b/tests/framework/validators/ValidatorTest.php @@ -188,7 +188,7 @@ class ValidatorTest extends TestCase $this->assertCount(3, $args); $this->assertEquals('val_attr_a', $args[0]); $this->assertEquals(['foo' => 'bar'], $args[1]); - $this->assertInstanceOf(InlineValidator::className(), $args[2]); + $this->assertInstanceOf(InlineValidator::class, $args[2]); } public function testClientValidateAttribute() @@ -208,7 +208,7 @@ class ValidatorTest extends TestCase $this->assertCount(3, $args); $this->assertEquals('val_attr_a', $args[0]); $this->assertEquals(['foo' => 'bar'], $args[1]); - $this->assertInstanceOf(InlineValidator::className(), $args[2]); + $this->assertInstanceOf(InlineValidator::class, $args[2]); } public function testIsActive() diff --git a/tests/framework/web/ErrorActionTest.php b/tests/framework/web/ErrorActionTest.php index 3ec4337..7402032 100644 --- a/tests/framework/web/ErrorActionTest.php +++ b/tests/framework/web/ErrorActionTest.php @@ -22,7 +22,7 @@ class ErrorActionTest extends TestCase $this->mockApplication([ 'components' => [ 'request' => [ - 'class' => Request::className(), + 'class' => Request::class, ], ], ]); @@ -115,7 +115,7 @@ class TestController extends Controller { return [ 'error' => array_merge([ - 'class' => ErrorAction::className(), + 'class' => ErrorAction::class, 'view' => '@yiiunit/data/views/error.php', ], $this->actionConfig), ];