itstructure /
yii2-template-multilanguage
| 1 | <?php |
||||||||
| 2 | |||||||||
| 3 | namespace tests\unit\models; |
||||||||
| 4 | |||||||||
| 5 | use app\models\User; |
||||||||
| 6 | |||||||||
| 7 | class UserTest extends \Codeception\Test\Unit |
||||||||
|
0 ignored issues
–
show
|
|||||||||
| 8 | { |
||||||||
| 9 | public function testFindUserById() |
||||||||
| 10 | { |
||||||||
| 11 | expect_that($user = User::findIdentity(100)); |
||||||||
|
0 ignored issues
–
show
The function
expect_that was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 12 | expect($user->username)->equals('admin'); |
||||||||
|
0 ignored issues
–
show
The function
expect was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 13 | |||||||||
| 14 | expect_not(User::findIdentity(999)); |
||||||||
|
0 ignored issues
–
show
The function
expect_not was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 15 | } |
||||||||
| 16 | |||||||||
| 17 | public function testFindUserByAccessToken() |
||||||||
| 18 | { |
||||||||
| 19 | expect_that($user = User::findIdentityByAccessToken('100-token')); |
||||||||
|
0 ignored issues
–
show
The function
expect_that was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 20 | expect($user->username)->equals('admin'); |
||||||||
|
0 ignored issues
–
show
The function
expect was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 21 | |||||||||
| 22 | expect_not(User::findIdentityByAccessToken('non-existing')); |
||||||||
|
0 ignored issues
–
show
The function
expect_not was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 23 | } |
||||||||
| 24 | |||||||||
| 25 | public function testFindUserByUsername() |
||||||||
| 26 | { |
||||||||
| 27 | expect_that($user = User::findByUsername('admin')); |
||||||||
|
0 ignored issues
–
show
The method
findByUsername() does not exist on app\models\User. Maybe you want to declare this class abstract?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
The function
expect_that was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 28 | expect_not(User::findByUsername('not-admin')); |
||||||||
|
0 ignored issues
–
show
The function
expect_not was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 29 | } |
||||||||
| 30 | |||||||||
| 31 | /** |
||||||||
| 32 | * @depends testFindUserByUsername |
||||||||
| 33 | */ |
||||||||
| 34 | public function testValidateUser($user) |
||||||||
| 35 | { |
||||||||
| 36 | $user = User::findByUsername('admin'); |
||||||||
| 37 | expect_that($user->validateAuthKey('test100key')); |
||||||||
|
0 ignored issues
–
show
The function
expect_that was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 38 | expect_not($user->validateAuthKey('test102key')); |
||||||||
|
0 ignored issues
–
show
The function
expect_not was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||||
| 39 | |||||||||
| 40 | expect_that($user->validatePassword('admin')); |
||||||||
| 41 | expect_not($user->validatePassword('123456')); |
||||||||
| 42 | } |
||||||||
| 43 | |||||||||
| 44 | } |
||||||||
| 45 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths