tests/TripTest.php
Avoid using static access to class '\App\Entities\Trip' in method 'testTripGetSuccess'. Open
Open
$trips = Trip::all();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class TripTest extends TestCase
- Exclude checks
Function closing brace must go on the next line following the body; found 1 blank lines before brace Open
Open
}
- Exclude checks
Function closing brace must go on the next line following the body; found 1 blank lines before brace Open
Open
}
- Exclude checks
Function closing brace must go on the next line following the body; found 1 blank lines before brace Open
Open
}
- Exclude checks
The closing brace for the class must go on the next line after the body Open
Open
}
- Exclude checks
Whitespace found at end of line Open
Open
->post('/api/v1/trip', ['api_token' => env('APP_TOKEN'),
- Exclude checks
Whitespace found at end of line Open
Open
'fuel_type' => 2,
- Exclude checks
Whitespace found at end of line Open
Open
'fuel_amount' => 30.05,
- Exclude checks
Whitespace found at end of line Open
Open
$this->seeInDatabase('trips', ['vehicle_id' => 1,
- Exclude checks
Whitespace found at end of line Open
Open
'fuel_cost' => 51.10,
- Exclude checks
Whitespace found at end of line Open
Open
'fuel_cost' => 51.10,
- Exclude checks
Whitespace found at end of line Open
Open
'fuel_type' => 2,
- Exclude checks
Whitespace found at end of line Open
Open
'vehicle_id' => 1,
- Exclude checks
Whitespace found at end of line Open
Open
'fuel_type' => 2,
- Exclude checks
Whitespace found at end of line Open
Open
'email' => 'admin@alientronics.com.br',
- Exclude checks
Whitespace found at end of line Open
Open
'fuel_amount' => 30.05,
- Exclude checks
Whitespace found at end of line Open
Open
'fuel_cost' => 51.10,
- Exclude checks
Whitespace found at end of line Open
Open
$this->post('/api/v1/trip', ['vehicle_id' => 1,
- Exclude checks
Whitespace found at end of line Open
Open
'end_mileage' => 123,
- Exclude checks
Whitespace found at end of line Open
Open
'fuel_amount' => 30.05,
- Exclude checks
Whitespace found at end of line Open
Open
'end_mileage' => 123,
- Exclude checks
Whitespace found at end of line Open
Open
'end_mileage' => 123,
- Exclude checks