@@ -20,7 +20,7 @@ protected function postLogin($credentials)
20
20
{
21
21
$ response = $ this ->http ->request ('POST ' , 'authenticate ' , [
22
22
'headers ' => [
23
- 'Authorization ' => 'Basic ' . $ credentials ,
23
+ 'Authorization ' => 'Basic ' . base64_encode ( $ credentials) ,
24
24
]]);
25
25
return $ response ;
26
26
}
@@ -35,7 +35,7 @@ protected function getJSON($response)
35
35
36
36
public function testLogin ()
37
37
{
38
- $ response = $ this ->postLogin (base64_encode ( 'admin:admin1234 ' ) );
38
+ $ response = $ this ->postLogin ('admin:admin1234 ' );
39
39
$ this ->assertEquals (200 , $ response ->getStatusCode ());
40
40
$ json = $ this ->getJSON ($ response );
41
41
$ this ->assertEquals ('common.SUCCESSFUL_REQUEST ' , $ json ['messages ' ]);
@@ -45,15 +45,15 @@ public function testLogin()
45
45
46
46
public function testLoginUserNotRegistered ()
47
47
{
48
- $ response = $ this ->postLogin (base64_encode ( 'admin1234:admin1234 ' ) );
48
+ $ response = $ this ->postLogin ('admin1234:admin1234 ' );
49
49
$ this ->assertEquals (404 , $ response ->getStatusCode ());
50
50
$ json = $ this ->getJSON ($ response );
51
51
$ this ->assertEquals ('login.USER_IS_NOT_REGISTERED ' , $ json ['messages ' ]);
52
52
}
53
53
54
54
public function testLoginWrongPassword ()
55
55
{
56
- $ response = $ this ->postLogin (base64_encode ( 'admin:admin12345 ' ) );
56
+ $ response = $ this ->postLogin ('admin:admin12345 ' );
57
57
$ this ->assertEquals (400 , $ response ->getStatusCode ());
58
58
$ json = $ this ->getJSON ($ response );
59
59
$ this ->assertEquals ('login.WRONG_USER_PASSWORD ' , $ json ['messages ' ]);
0 commit comments