Browse Source

::className() -> ::class

tags/3.0.0-alpha1
Alexander Makarov 7 years ago
parent
commit
2875624600
No known key found for this signature in database
GPG Key ID: 3617B79C6A325E4A
  1. 10
      tests/framework/rbac/DbManagerTestCase.php
  2. 2
      tests/framework/validators/ValidatorTest.php

10
tests/framework/rbac/DbManagerTestCase.php

@ -173,7 +173,7 @@ abstract class DbManagerTestCase extends ManagerTestCase
if ($isValid) { if ($isValid) {
$this->assertTrue(isset($permissions['createPost'])); $this->assertTrue(isset($permissions['createPost']));
$this->assertInstanceOf(Permission::className(), $permissions['createPost']); $this->assertInstanceOf(Permission::class, $permissions['createPost']);
} else { } else {
$this->assertEmpty($permissions); $this->assertEmpty($permissions);
} }
@ -190,7 +190,7 @@ abstract class DbManagerTestCase extends ManagerTestCase
if ($isValid) { if ($isValid) {
$this->assertTrue(isset($roles['Author'])); $this->assertTrue(isset($roles['Author']));
$this->assertInstanceOf(Role::className(), $roles['Author']); $this->assertInstanceOf(Role::class, $roles['Author']);
} else { } else {
$this->assertEmpty($roles); $this->assertEmpty($roles);
} }
@ -206,7 +206,7 @@ abstract class DbManagerTestCase extends ManagerTestCase
$assignment = $this->auth->getAssignment('createPost', $searchUserId); $assignment = $this->auth->getAssignment('createPost', $searchUserId);
if ($isValid) { if ($isValid) {
$this->assertInstanceOf(Assignment::className(), $assignment); $this->assertInstanceOf(Assignment::class, $assignment);
$this->assertEquals($userId, $assignment->userId); $this->assertEquals($userId, $assignment->userId);
} else { } else {
$this->assertEmpty($assignment); $this->assertEmpty($assignment);
@ -224,8 +224,8 @@ abstract class DbManagerTestCase extends ManagerTestCase
if ($isValid) { if ($isValid) {
$this->assertNotEmpty($assignments); $this->assertNotEmpty($assignments);
$this->assertInstanceOf(Assignment::className(), $assignments['createPost']); $this->assertInstanceOf(Assignment::class, $assignments['createPost']);
$this->assertInstanceOf(Assignment::className(), $assignments['updatePost']); $this->assertInstanceOf(Assignment::class, $assignments['updatePost']);
} else { } else {
$this->assertEmpty($assignments); $this->assertEmpty($assignments);
} }

2
tests/framework/validators/ValidatorTest.php

@ -82,7 +82,7 @@ class ValidatorTest extends TestCase
$validator = TestValidator::createValidator('required', $model, ['firstAttribute']); $validator = TestValidator::createValidator('required', $model, ['firstAttribute']);
$this->assertInstanceOf(RequiredValidator::className(), $validator); $this->assertInstanceOf(RequiredValidator::class, $validator);
} }
public function testValidate() public function testValidate()

Loading…
Cancel
Save