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

GetUserTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 21
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testGetUser_() 0 14 1
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