mirror of https://github.com/kcal-app/kcal.git
39 lines
755 B
PHP
39 lines
755 B
PHP
<?php
|
|
|
|
namespace Tests\Feature\JsonApi;
|
|
|
|
use App\Models\Goal;
|
|
use Database\Factories\GoalFactory;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Tests\Feature\JsonApi\Traits\BelongsToUser;
|
|
|
|
class GoalApiTest extends JsonApiTestCase
|
|
{
|
|
use RefreshDatabase, BelongsToUser;
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
public function factory(): GoalFactory
|
|
{
|
|
return Goal::factory();
|
|
}
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
public function resourceName(): string
|
|
{
|
|
return 'goals';
|
|
}
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
protected function createInstances(int $count = 1): Collection {
|
|
return $this->factory()->count($count)->for($this->user)->create();
|
|
}
|
|
|
|
}
|