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 ( 75413a...5c1bf5 )
by Oliver
05:22
created

MmexControllerTest   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 183
Duplicated Lines 19.13 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 11
lcom 1
cbo 3
dl 35
loc 183
rs 10
c 2
b 1
f 0

11 Methods

Rating   Name   Duplication   Size   Complexity  
A testDeleteAllPayees() 11 11 1
A testImportPayees() 0 19 1
A testDeleteAllAccounts() 11 11 1
A testImportAccounts() 0 12 1
A testDeleteAllCategories() 12 12 1
A testImportCategories() 0 16 1
A testImportSubCategories() 0 19 1
A testDeleteTransactions() 0 11 1
B testDownloadTransactions() 0 29 1
A testDownloadAttachment() 0 18 1
A addReceiptsToTransaction() 0 6 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/**
3
 * MmexControllerTest.php, laravel-money-manager-ex.
4
 *
5
 * This File belongs to to Project laravel-money-manager-ex
6
 *
7
 * @author Oliver Kaufmann <[email protected]>
8
 *
9
 * @version 1.0
10
 */
11
12
namespace App\Tests\Api;
13
14
use App\Models\Account;
15
use App\Models\Category;
16
use App\Models\Payee;
17
use App\Models\Transaction;
18
19
class MmexControllerTest extends AbstractApiTestCase
20
{
21 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...
22
    {
23
        // Arrange
24
        $payee = factory(Payee::class)->create();
25
        $url = $this->buildUrl('', ['delete_payee' => 'true']);
26
27
        // Act & Assert
28
        $this->get($url)
29
            ->seeSuccess()
30
            ->dontSeeInDatabase('payees', ['name' => $payee->name]);
31
    }
32
33
    public function testImportPayees()
34
    {
35
        // Arrange
36
        $food = factory(Category::class)->create(['name' => 'Food']);
37
        $foodPurchases = factory(Category::class)->create(['name' => 'Purchases', 'parent_id' => $food->id]);
38
        $bills = factory(Category::class)->create(['name' => 'Bills']);
39
        $billsServices = factory(Category::class)->create(['name' => 'Services', 'parent_id' => $bills->id]);
40
41
        $data = ['MMEX_Post' => '{ "Payees" : [ { "PayeeName" : "Mc Donalds", "DefCateg" : "'.$food->name.'", "DefSubCateg" : "'.$foodPurchases->name.'" },'.
42
            '{ "PayeeName" : "Spotify", "DefCateg" : "'.$bills->name.'", "DefSubCateg" : "'.$billsServices->name.'" } ] }',];
43
44
        $url = $this->buildUrl('', ['import_payee' => 'true']);
45
46
        // Act & Assert
47
        $this->postJson($url, $data)
48
            ->seeSuccess()
49
            ->seeInDatabase('payees', ['name' => 'Mc Donalds', 'last_category_id' => $foodPurchases->id])
50
            ->seeInDatabase('payees', ['name' => 'Spotify', 'last_category_id' => $billsServices->id]);
51
    }
52
53 View Code Duplication
    public function testDeleteAllAccounts()
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...
54
    {
55
        // Arrange
56
        $account = factory(Account::class)->create();
57
        $url = $this->buildUrl('', ['delete_bankaccount' => 'true']);
58
59
        // Act & Assert
60
        $this->get($url)
61
            ->seeSuccess()
62
            ->dontSeeInDatabase('accounts', ['name' => $account->name]);
63
    }
64
65
    public function testImportAccounts()
66
    {
67
        // Arrange
68
        $data = ['MMEX_Post' => '{ "Accounts" : [ { "AccountName" : "Creditcard" }, { "AccountName" : "Private Account" } ] }'];
69
        $url = $this->buildUrl('', ['import_bankaccount' => 'true']);
70
71
        // Act & Assert
72
        $this->postJson($url, $data)
73
            ->seeSuccess()
74
            ->seeInDatabase('accounts', ['name' => 'Creditcard'])
75
            ->seeInDatabase('accounts', ['name' => 'Private Account']);
76
    }
77
78 View Code Duplication
    public function testDeleteAllCategories()
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...
79
    {
80
        // Arrange
81
        $categorie = factory(Category::class)->create();
82
83
        $url = $this->buildUrl('', ['delete_category' => 'true']);
84
85
        // Act & Assert
86
        $this->get($url)
87
            ->seeSuccess()
88
            ->dontSeeInDatabase('categories', ['name' => $categorie->name]);
89
    }
90
91
    public function testImportCategories()
92
    {
93
        // Arrange
94
        $data = ['MMEX_Post' => '{ "Categories" : [ { "CategoryName" : "Bills", "SubCategoryName" : "Telecom" }, { "CategoryName" : "Bills", "SubCategoryName" : "Water" }, { "CategoryName" : "Automobile", "SubCategoryName" : "Maintenance" }, { "CategoryName" : "Automobile", "SubCategoryName" : "Parking" } ] }'];
95
        $url = $this->buildUrl('', ['import_category' => 'true']);
96
97
        // Act & Assert
98
        $this->postJson($url, $data)
99
            ->seeSuccess()
100
            ->seeInDatabase('categories', ['name' => 'Bills'])
101
            ->seeInDatabase('categories', ['name' => 'Telecom'])
102
            ->seeInDatabase('categories', ['name' => 'Water'])
103
            ->seeInDatabase('categories', ['name' => 'Automobile'])
104
            ->seeInDatabase('categories', ['name' => 'Maintenance'])
105
            ->seeInDatabase('categories', ['name' => 'Parking']);
106
    }
107
108
    public function testImportSubCategories()
109
    {
110
        // Arrange
111
        $data = ['MMEX_Post' => '{ "Categories" : [ { "CategoryName" : "Bills", "SubCategoryName" : "Telecom" }, { "CategoryName" : "Bills", "SubCategoryName" : "Water" }, { "CategoryName" : "Automobile", "SubCategoryName" : "Maintenance" }, { "CategoryName" : "Automobile", "SubCategoryName" : "Parking" } ] }'];
112
        $url = $this->buildUrl('', ['import_category' => 'true']);
113
114
        $bills = factory(Category::class)->create(['name' => 'Bills']);
115
        $automobile = factory(Category::class)->create(['name' => 'Automobile']);
116
117
        // Act & Assert
118
        $this->postJson($url, $data)
119
            ->seeSuccess()
120
            ->seeInDatabase('categories', ['name' => 'Bills', 'id' => $bills->id])
121
            ->seeInDatabase('categories', ['name' => 'Telecom', 'parent_id' => $bills->id])
122
            ->seeInDatabase('categories', ['name' => 'Water', 'parent_id' => $bills->id])
123
            ->seeInDatabase('categories', ['name' => 'Automobile', 'id' => $automobile->id])
124
            ->seeInDatabase('categories', ['name' => 'Maintenance', 'parent_id' => $automobile->id])
125
            ->seeInDatabase('categories', ['name' => 'Parking', 'parent_id' => $automobile->id]);
126
    }
127
128
    public function testDeleteTransactions()
129
    {
130
        // Arrange
131
        $transaction = factory(Transaction::class)->create();
132
        $url = $this->buildUrl('', ['delete_group' => $transaction->id]);
133
134
        // Act & Assert
135
        $this->get($url)
136
            ->seeSuccess()
137
            ->seeIsSoftDeletedInDatabase('transactions', ['payee_name' => $transaction->payee_name]); // must not be deleted! just soft deleted.
138
    }
139
140
    public function testDownloadTransactions()
141
    {
142
        // Arrange
143
        /** @var Transaction $transaction */
144
        $transaction = factory(Transaction::class)->create();
145
        $this->addReceiptsToTransaction($transaction);
146
        $url = $this->buildUrl('', ['download_transaction' => 'true']);
147
148
        // Act & Assert
149
        $this->get($url)
150
            ->seeStatusCode(200)
151
            ->seeJson(
152
                [
153
                    'ID'          => $transaction->id,
0 ignored issues
show
Documentation introduced by
The property id does not exist on object<App\Models\Transaction>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
154
                    'Date'        => $transaction->date,
0 ignored issues
show
Documentation introduced by
The property date does not exist on object<App\Models\Transaction>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
155
                    'Account'     => $transaction->account_name,
0 ignored issues
show
Documentation introduced by
The property account_name does not exist on object<App\Models\Transaction>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
156
                    'ToAccount'   => $transaction->to_account_name,
0 ignored issues
show
Documentation introduced by
The property to_account_name does not exist on object<App\Models\Transaction>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
157
                    'Status'      => $transaction->status->slug,
0 ignored issues
show
Documentation introduced by
The property status does not exist on object<App\Models\Transaction>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
158
                    'Type'        => $transaction->type->name,
0 ignored issues
show
Documentation introduced by
The property type does not exist on object<App\Models\Transaction>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
159
                    'Payee'       => $transaction->payee_name,
0 ignored issues
show
Documentation introduced by
The property payee_name does not exist on object<App\Models\Transaction>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
160
                    'Category'    => $transaction->category_name,
0 ignored issues
show
Documentation introduced by
The property category_name does not exist on object<App\Models\Transaction>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
161
                    'SubCategory' => $transaction->sub_category_name,
0 ignored issues
show
Documentation introduced by
The property sub_category_name does not exist on object<App\Models\Transaction>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
162
                    'Amount'      => $transaction->amount,
0 ignored issues
show
Documentation introduced by
The property amount does not exist on object<App\Models\Transaction>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
163
                    'Notes'       => $transaction->notes,
0 ignored issues
show
Documentation introduced by
The property notes does not exist on object<App\Models\Transaction>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
164
                    'Attachments' => 'Transaction_'.$transaction->id.'_test-receipt.png;Transaction_'.$transaction->id
0 ignored issues
show
Documentation introduced by
The property id does not exist on object<App\Models\Transaction>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
165
                        .'_test-receipt-2.png;Transaction_'.$transaction->id.'_test-receipt-3.png'
0 ignored issues
show
Documentation introduced by
The property id does not exist on object<App\Models\Transaction>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
166
                ]
167
            );
168
    }
169
170
    /**
171
     * Attachment file name will be provided as comma separated list in the transaction download.
172
     */
173
    public function testDownloadAttachment()
174
    {
175
        // Arrange
176
        /** @var Transaction $transaction */
177
        $transaction = factory(Transaction::class)->create();
178
        $this->addReceiptsToTransaction($transaction);
179
        $fileName = 'Transaction_'.$transaction->id.'_test-receipt-3.png';
0 ignored issues
show
Documentation introduced by
The property id does not exist on object<App\Models\Transaction>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
180
        $url = $this->buildUrl('', ['download_attachment' => $fileName]);
181
182
        // Act & Assert
183
        $this->get($url)
184
            ->seeStatusCode(200)
185
            ->seeHeader('Content-Type', '')
186
            ->seeHeader('Cache-Control', 'public')
187
            ->seeHeader('Content-Description', 'File Transfer')
188
            ->seeHeader('Content-Disposition', 'attachment; filename= '.$fileName)
189
            ->seeHeader('Content-Transfer-Encoding', 'binary');
190
    }
191
192
    /**
193
     * @param $transaction
194
     */
195
    protected function addReceiptsToTransaction(Transaction $transaction)
196
    {
197
        $transaction->addAttachment(base_path('tests/data/test-receipt.png'), true);
198
        $transaction->addAttachment(base_path('tests/data/test-receipt-2.png'), true);
199
        $transaction->addAttachment(base_path('tests/data/test-receipt-3.png'), true);
200
    }
201
}
202