GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — rewrite-laravel ( ad2267...b1fe86 )
by Oliver
07:49
created

PayeeTest::testImportPayees()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 9.3142
c 0
b 0
f 0
cc 1
eloc 12
nc 1
nop 0
1
<?php
2
3
namespace Tests\Feature\MmexClient;
4
5
use App\Models\Category;
6
use App\Models\Payee;
7
use Tests\Feature\Api\AbstractMmexTestCase;
8
9
class PayeeTest extends AbstractMmexTestCase
10
{
11 View Code Duplication
    public function testDeleteAllPayees()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
    {
13
        // Arrange
14
        $payee = factory(Payee::class)->create();
15
        $url = $this->buildUrl('', ['delete_payee' => 'true']);
16
17
        // Act
18
        $response = $this->get($url);
19
20
        // Assert
21
        $this->seeSuccess($response);
22
        $this->assertDatabaseMissing('payees', ['name' => $payee->name]);
23
    }
24
25
    public function testImportPayees()
26
    {
27
        // Arrange
28
        $food = factory(Category::class)->create(['name' => 'Food']);
29
        $foodPurchases = factory(Category::class)->create(['name' => 'Purchases', 'parent_id' => $food->id]);
30
        $bills = factory(Category::class)->create(['name' => 'Bills']);
31
        $billsServices = factory(Category::class)->create(['name' => 'Services', 'parent_id' => $bills->id]);
32
33
        $data = ['MMEX_Post' => '{ "Payees" : [ { "PayeeName" : "Mc Donalds", "DefCateg" : "'.$food->name.'", "DefSubCateg" : "'.$foodPurchases->name.'" },'.
34
            '{ "PayeeName" : "Spotify", "DefCateg" : "'.$bills->name.'", "DefSubCateg" : "'.$billsServices->name.'" } ] }',];
35
36
        $url = $this->buildUrl('', ['import_payee' => 'true']);
37
38
        // Act
39
        $response = $this->postJson($url, $data);
40
41
        // Assert
42
        $this->seeSuccess($response);
43
        $this->assertDatabaseHas('payees', ['name' => 'Mc Donalds', 'last_category_id' => $foodPurchases->id]);
44
        $this->assertDatabaseHas('payees', ['name' => 'Spotify', 'last_category_id' => $billsServices->id]);
45
    }
46
}
47