Completed
Push — master ( 857394...4794c5 )
by Mahmoud
03:25
created

testCreatePaypalAccountObject()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 11
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace App\Containers\Stripe\Tests\Unit;
4
5
use App\Containers\Paypal\Tasks\CreatePaypalAccountObjectTask;
6
use App\Port\Test\PHPUnit\Abstracts\TestCase;
7
use Illuminate\Support\Facades\App;
8
9
/**
10
 * Class CreatePaypalAccountObjectTest.
11
 *
12
 * @author Mahmoud Zalt <[email protected]>
13
 */
14
class CreatePaypalAccountObjectTest extends TestCase
15
{
16
17
    public function testCreatePaypalAccountObject()
18
    {
19
        // get the logged in user (create one if no one is logged in)
20
        $user = $this->registerAndLoginTestingUser();
21
22
        // create stripe account for this user
23
        $createPaypalAccountAction = App::make(CreatePaypalAccountObjectTask::class);
24
        $paypalAccount = $createPaypalAccountAction->run($user, '8mBD5S1SoyD4zL');
0 ignored issues
show
Unused Code introduced by
$paypalAccount 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...
25
26
        $this->seeInDatabase('paypal_accounts', ['user_id' => $user->id]);
27
    }
28
29
}
30