Completed
Push — master ( d7caaf...048f0c )
by Mahmoud
04:10
created

RefreshUserTest::testRefreshAnotherUserById_()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
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\Containers\User\Tests\TestCase;
7
8
/**
9
 * Class RefreshUserTest.
10
 *
11
 * @author Mahmoud Zalt <[email protected]>
12
 */
13
class RefreshUserTest extends TestCase
14
{
15
16
    protected $endpoint = 'post@users/{id}/refresh';
17
18
    protected $access = [
19
        'roles'       => '',
20
        'permissions' => '',
21
    ];
22
23
    public function testRefreshUserById_()
24
    {
25
        $user = $this->getTestingUser();
26
27
        // send the HTTP request
28
        $response = $this->injectId($user->id)->makeCall();
29
30
        // assert response status is correct
31
        $this->assertEquals('200', $response->getStatusCode());
32
    }
33
34
    public function testRefreshAnotherUserById_()
35
    {
36
        $user = $this->getTestingUser();
0 ignored issues
show
Unused Code introduced by
$user is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
37
38
        $anotherUser = factory(User::class)->create();
39
        // send the HTTP request
40
        $response = $this->injectId($anotherUser->id)->makeCall();
41
42
        // assert response status is correct
43
        $this->assertEquals('500', $response->getStatusCode());
44
    }
45
46
}
47