alientronics/fleetany-api

View on GitHub
tests/TripTest.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class '\App\Entities\Trip' in method 'testTripGetSuccess'.
Open

        $trips = Trip::all();
Severity: Minor
Found in tests/TripTest.php by phpmd

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

class TripTest extends TestCase
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

    }
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

    }
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

    }
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

The closing brace for the class must go on the next line after the body
Open

}
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Whitespace found at end of line
Open

            ->post('/api/v1/trip', ['api_token' => env('APP_TOKEN'), 
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Whitespace found at end of line
Open

                                    'fuel_type' => 2, 
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Whitespace found at end of line
Open

                                    'fuel_amount' => 30.05, 
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Whitespace found at end of line
Open

        $this->seeInDatabase('trips', ['vehicle_id' => 1, 
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Whitespace found at end of line
Open

                                    'fuel_cost' => 51.10, 
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Whitespace found at end of line
Open

                                    'fuel_cost' => 51.10, 
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Whitespace found at end of line
Open

                                    'fuel_type' => 2, 
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Whitespace found at end of line
Open

                                    'vehicle_id' => 1, 
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Whitespace found at end of line
Open

                                    'fuel_type' => 2, 
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Whitespace found at end of line
Open

                                    'email' => 'admin@alientronics.com.br', 
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Whitespace found at end of line
Open

                                    'fuel_amount' => 30.05, 
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Whitespace found at end of line
Open

                                    'fuel_cost' => 51.10, 
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Whitespace found at end of line
Open

        $this->post('/api/v1/trip', ['vehicle_id' => 1, 
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Whitespace found at end of line
Open

                                    'end_mileage' => 123, 
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Whitespace found at end of line
Open

                                    'fuel_amount' => 30.05, 
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Whitespace found at end of line
Open

                                    'end_mileage' => 123, 
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

Whitespace found at end of line
Open

                                    'end_mileage' => 123, 
Severity: Minor
Found in tests/TripTest.php by phpcodesniffer

There are no issues that match your filters.

Category
Status