Skip to content

Commit 4c7b4a1

Browse files
committed
Refactor tests
1 parent f16882d commit 4c7b4a1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.5(Feb 4, 2019)
2+
3+
* Refactor tests
4+
15
## 1.0.4 (Feb 4, 2019)
26

37
* Refactor tests

tests/0IndexTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ protected function postLogin($credentials)
2020
{
2121
$response = $this->http->request('POST', 'authenticate', [
2222
'headers' => [
23-
'Authorization' => 'Basic ' . $credentials,
23+
'Authorization' => 'Basic ' . base64_encode($credentials),
2424
]]);
2525
return $response;
2626
}
@@ -35,7 +35,7 @@ protected function getJSON($response)
3535

3636
public function testLogin()
3737
{
38-
$response = $this->postLogin(base64_encode('admin:admin1234'));
38+
$response = $this->postLogin('admin:admin1234');
3939
$this->assertEquals(200, $response->getStatusCode());
4040
$json = $this->getJSON($response);
4141
$this->assertEquals('common.SUCCESSFUL_REQUEST', $json['messages']);
@@ -45,15 +45,15 @@ public function testLogin()
4545

4646
public function testLoginUserNotRegistered()
4747
{
48-
$response = $this->postLogin(base64_encode('admin1234:admin1234'));
48+
$response = $this->postLogin('admin1234:admin1234');
4949
$this->assertEquals(404, $response->getStatusCode());
5050
$json = $this->getJSON($response);
5151
$this->assertEquals('login.USER_IS_NOT_REGISTERED', $json['messages']);
5252
}
5353

5454
public function testLoginWrongPassword()
5555
{
56-
$response = $this->postLogin(base64_encode('admin:admin12345'));
56+
$response = $this->postLogin('admin:admin12345');
5757
$this->assertEquals(400, $response->getStatusCode());
5858
$json = $this->getJSON($response);
5959
$this->assertEquals('login.WRONG_USER_PASSWORD', $json['messages']);

0 commit comments

Comments
 (0)