Completed
Push — master ( 61a5ce...0094ca )
by Mahmoud
03:11
created

CreateApplicationWithTokenTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
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 24
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCreateApplicationWithToken_() 0 17 1
1
<?php
2
3
namespace App\Containers\Application\UI\API\Tests\Functional;
4
5
use App\Port\Tests\PHPUnit\Abstracts\TestCase;
6
7
/**
8
 * Class CreateApplicationWithTokenTest.
9
 *
10
 * @author Mahmoud Zalt <[email protected]>
11
 */
12
class CreateApplicationWithTokenTest extends TestCase
13
{
14
15
    private $endpoint = '/apps';
16
17
    public function testCreateApplicationWithToken_()
18
    {
19
        $user = $this->registerAndLoginTestingDeveloper();
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...
20
21
        $data = [
22
            'name' => 'My first App'
23
        ];
24
25
        // send the HTTP request
26
        $response = $this->apiCall($this->endpoint, 'post', $data);
27
28
        // assert response status is correct
29
        $this->assertEquals($response->getStatusCode(), '200');
30
31
        // assert response contain the data
32
        $this->assertResponseContainKeys(['token'], $response);
33
    }
34
35
}
36