@@ -8,24 +8,24 @@ class UserTest extends \Codeception\Test\Unit
8
8
{
9
9
public function testFindUserById ()
10
10
{
11
- expect_that ($ user = User::findIdentity (100 ));
12
- expect ($ user ->username )->equals ('admin ' );
11
+ verify ($ user = User::findIdentity (100 ))-> notEmpty ( );
12
+ verify ($ user ->username )->equals ('admin ' );
13
13
14
- expect_not (User::findIdentity (999 ));
14
+ verify (User::findIdentity (999 ))-> empty ( );
15
15
}
16
16
17
17
public function testFindUserByAccessToken ()
18
18
{
19
- expect_that ($ user = User::findIdentityByAccessToken ('100-token ' ));
20
- expect ($ user ->username )->equals ('admin ' );
19
+ verify ($ user = User::findIdentityByAccessToken ('100-token ' ))-> notEmpty ( );
20
+ verify ($ user ->username )->equals ('admin ' );
21
21
22
- expect_not (User::findIdentityByAccessToken ('non-existing ' ));
22
+ verify (User::findIdentityByAccessToken ('non-existing ' ))-> empty ( );
23
23
}
24
24
25
25
public function testFindUserByUsername ()
26
26
{
27
- expect_that ($ user = User::findByUsername ('admin ' ));
28
- expect_not (User::findByUsername ('not-admin ' ));
27
+ verify ($ user = User::findByUsername ('admin ' ))-> notEmpty ( );
28
+ verify (User::findByUsername ('not-admin ' ))-> empty ( );
29
29
}
30
30
31
31
/**
@@ -34,11 +34,11 @@ public function testFindUserByUsername()
34
34
public function testValidateUser ($ user )
35
35
{
36
36
$ user = User::findByUsername ('admin ' );
37
- expect_that ($ user ->validateAuthKey ('test100key ' ));
38
- expect_not ($ user ->validateAuthKey ('test102key ' ));
37
+ verify ($ user ->validateAuthKey ('test100key ' ))-> notEmpty ( );
38
+ verify ($ user ->validateAuthKey ('test102key ' ))-> empty ( );
39
39
40
- expect_that ($ user ->validatePassword ('admin ' ));
41
- expect_not ($ user ->validatePassword ('123456 ' ));
40
+ verify ($ user ->validatePassword ('admin ' ))-> notEmpty ( );
41
+ verify ($ user ->validatePassword ('123456 ' ))-> empty ( );
42
42
}
43
43
44
44
}
0 commit comments