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 ( 600c36...11aeee )
by Oliver
03:44
created

TransactionController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
B it_can_get_all_transactions() 0 34 1
1
<?php
2
3
namespace Tests\Feature\Api;
4
5
use App\Models\Transaction;
6
use Tests\Features\TestCase;
7
8
class TransactionController extends TestCase
9
{
10
    /**
11
     * A basic test example.
12
     * @test
13
     * @return void
14
     */
15
    public function it_can_get_all_transactions()
16
    {
17
        // Arrange
18
        $url = '/api/v1/transactions';
19
        $transaction = factory(Transaction::class)->create();
20
21
        // Act
22
        $response = $this->get($url);
23
24
        // Assert
25
        $response->assertStatus(200)
26
            ->assertJsonFragment([
27
                'id'                => $transaction->id,
28
                'status'            => [
29
                    'id'   => $transaction->status->id,
30
                    'name' => $transaction->status->name,
31
                    'slug' => $transaction->status->slug
32
                ],
33
                'type'              => [
34
                    'id'   => $transaction->type->id,
35
                    'name' => $transaction->type->name,
36
                    'slug' => $transaction->type->slug
37
                ],
38
                'account_name'      => $transaction->account_name,
39
                'to_account_name'   => $transaction->to_account_name,
40
                'payee_name'        => $transaction->payee_name,
41
                'category_name'     => $transaction->category_name,
42
                'sub_category_name' => $transaction->sub_category_name,
43
                'amount'            => round($transaction->amount, 2),
44
                'notes'             => $transaction->notes,
45
                'created_at'        => $transaction->created_at->toIso8601String(),
46
                'updated_at'        => $transaction->updated_at->toIso8601String()
47
            ]);
48
    }
49
}
50