Files
monica/tests/ApiTestCase.php
2023-05-05 15:30:41 +02:00

53 lines
1.3 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace Tests;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\Traits\Asserts;
class ApiTestCase extends TestCase
{
use Asserts,
DatabaseTransactions;
protected function links(string $path): array
{
return [
'first' => env('APP_URL').$path.'?page=1',
'last' => env('APP_URL').$path.'?page=1',
'prev' => null,
'next' => null,
];
}
protected function meta(string $path): array
{
return [
'current_page' => 1,
'from' => 1,
'last_page' => 1,
'links' => [
0 => [
'url' => null,
'label' => ' Previous',
'active' => false,
],
1 => [
'url' => env('APP_URL').$path.'?page=1',
'label' => '1',
'active' => true,
],
2 => [
'url' => null,
'label' => 'Next ',
'active' => false,
],
],
'path' => env('APP_URL').$path,
'per_page' => 10,
'to' => 1,
'total' => 1,
];
}
}