Completed
Push — master ( 2c6af0...6acd1a )
by Mahmoud
05:23
created

CreatePaypalAccountTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B testCreatePaypalAccount() 0 26 1
1
<?php
2
3
namespace App\Containers\Paypal\UI\API\Tests\Functional;
4
5
use App\Port\Tests\PHPUnit\Abstracts\TestCase;
6
7
/**
8
 * Class CreatePaypalAccountTest.
9
 *
10
 * @author Mahmoud Zalt <[email protected]>
11
 */
12
class CreatePaypalAccountTest extends TestCase
13
{
14
15
    private $endpoint = '/paypals';
16
17
    public function testCreatePaypalAccount()
18
    {
19
        $userDetails = [
20
            'name' => 'Mahmoud Zalt',
21
            'email' => '[email protected]',
22
            'password' => 'passssssssssss',
23
        ];
24
        // get the logged in user (create one if no one is logged in)
25
        $user = $this->registerAndLoginTestingUser($userDetails);
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...
26
27
        $data = [
28
           // TODO: To Be Continue...
29
        ];
30
31
        // send the HTTP request
32
        $response = $this->apiCall($this->endpoint, 'post', $data, true);
33
34
        // assert response status is correct
35
        $this->assertEquals($response->getStatusCode(), '202');
36
37
        // convert JSON response string to Object
38
        $responseObject = $this->getResponseObject($response);
39
40
        $this->assertEquals($responseObject->message, 'Paypal account created successfully.');
41
42
    }
43
44
}
45