Completed
Push — master ( 39f00f...ae9abb )
by Mahmoud
03:15
created

RefreshUserTest::testRefreshUserByToken_()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 8
loc 8
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace App\Containers\User\UI\API\Tests\Functional;
4
5
use App\Port\Test\PHPUnit\Abstracts\TestCase;
6
7
/**
8
 * Class RefreshUserTest.
9
 *
10
 * @author Mahmoud Zalt <[email protected]>
11
 */
12
class RefreshUserTest extends TestCase
13
{
14
15
    protected $endpoint = '/users/{id}/refresh';
16
17
    protected $access = [
18
        'roles'       => '',
19
        'permissions' => '',
20
    ];
21
22
    public function testRefreshUserById_()
23
    {
24
        // get the logged in user (create one if no one is logged in)
25
        $user = $this->createTestingUser();
26
27
        // send the HTTP request
28
        $response = $this->apiCall($this->injectEndpointId($this->endpoint, $user->id), 'post');
29
30
        // assert response status is correct
31
        $this->assertEquals('200', $response->getStatusCode());
32
    }
33
34
}
35