daniel-de-wit / lighthouse-sanctum

Laravel Sanctum support for Laravel Lighthouse
MIT License
56 stars 9 forks source link

Inconsistent use of static vs non-static assertions #61

Closed dennis-koster closed 3 years ago

dennis-koster commented 3 years ago

The use of static vs non-static assertions in the test cases is inconsistent. For instance: https://github.com/daniel-de-wit/lighthouse-sanctum/blob/master/tests/Integration/GraphQL/Mutations/RegisterTest.php#L45

For code consistency it would be better to pick either $this->assert or static::assert.

wimski commented 3 years ago

This is not inconsistent. Most assertion methods are static and therefore called as such (assertSame for example). The assertDatabaseHas method however is not static and therefore not called as such.

trait InteractsWithDatabase
{
    protected function assertDatabaseHas($table, array $data, $connection = null)
}