Completed
Push — master ( 071fd8...3c3f7e )
by Mahmoud
03:40
created

RefreshUserTest::testRefreshUserByVisitorId_()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 1

Duplication

Lines 18
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 18
loc 18
rs 9.4285
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Containers\User\UI\API\Tests\Functional;
4
5
use App\Port\Tests\PHPUnit\Abstracts\TestCase;
6
7
/**
8
 * Class RefreshUserTest.
9
 *
10
 * @author Mahmoud Zalt <[email protected]>
11
 */
12 View Code Duplication
class RefreshUserTest extends TestCase
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14
15
    private $endpoint = '/users/refresh';
16
17
    public function testRefreshUserById_()
18
    {
19
        // get the logged in user (create one if no one is logged in)
20
        $user = $this->registerAndLoginTestingUser();
21
22
        $data = [
23
            'user_id' => $user->id,
24
        ];
25
26
        // send the HTTP request
27
        $response = $this->apiCall($this->endpoint, 'post', $data);
28
29
        // assert response status is correct
30
        $this->assertEquals($response->getStatusCode(), '200');
31
    }
32
33
    public function testRefreshUserByToken_()
34
    {
35
        // send the HTTP request
36
        $response = $this->apiCall($this->endpoint, 'post', [], true);
37
38
        // assert response status is correct
39
        $this->assertEquals($response->getStatusCode(), '200');
40
    }
41
}
42