CreateStripeAccountObjectTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 16
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testCreateStripeAccountObject() 0 11 1
1
<?php
2
3
namespace App\Containers\Stripe\Tests\Unit;
4
5
use App\Containers\Stripe\Tasks\CreateStripeAccountObjectTask;
6
use App\Containers\Stripe\Tests\TestCase;
7
use Illuminate\Support\Facades\App;
8
9
/**
10
 * Class CreateStripeAccountObjectTest.
11
 *
12
 * @author Mahmoud Zalt <[email protected]>
13
 */
14
class CreateStripeAccountObjectTest extends TestCase
15
{
16
17
    public function testCreateStripeAccountObject()
18
    {
19
        // get the logged in user (create one if no one is logged in)
20
        $user = $this->getTestingUser();
21
22
        // create stripe account for this user
23
        $createStripeAccountAction = App::make(CreateStripeAccountObjectTask::class);
24
        $stripeAccount = $createStripeAccountAction->run($user, 'cus_8mBD5S1SoyD4zL', 'card_18Uck6KFvMcBUkvQorbBkYhR', 'credit', '4242', 'WsNM4K8puHbdS2VP');
0 ignored issues
show
Unused Code introduced by
$stripeAccount 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('stripe_accounts', ['user_id' => $user->id]);
27
    }
28
29
}
30