Completed
Push — master ( 09f73b...2e770a )
by Mahmoud
03:29
created

GetUserTest::testGetUser_()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 14
rs 9.4285
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
namespace App\Containers\User\UI\API\Tests\Functional;
4
5
use App\Containers\User\Models\User;
6
use App\Port\Test\PHPUnit\Abstracts\TestCase;
7
8
/**
9
 * Class GetUsersTest.
10
 *
11
 * @author  Mahmoud Zalt <[email protected]>
12
 */
13
class GetUserTest extends TestCase
14
{
15
16
    protected $endpoint = '/users/{id}';
17
18
    public function testGetUser_()
19
    {
20
        $admin = $this->getTestingAdmin();
21
22
        // send the HTTP request
23
        $response = $this->apiCall($this->injectEndpointId($this->endpoint, $admin->id), 'get', [], true);
24
25
        // assert response status is correct
26
        $this->assertEquals('200', $response->getStatusCode());
27
28
        $responseObject = $this->getResponseObject($response);
29
30
        $this->assertEquals($admin->name, $responseObject->data->name);
31
    }
32
33
}
34