Cover endOfPeriod method of the Navigation class

The custom frequency requires a timezone configuration, forcing it
to run in the integration test scope.

Running the integration tests requires a database connection in the
build process. It enables other case tests.

The API Tests cause interference in other tests, requiring isolating
them.
This commit is contained in:
Antonio Spinelli
2023-10-20 19:00:45 -03:00
parent b6aa76477e
commit dd2f8d4404
7 changed files with 197 additions and 26 deletions

View File

@@ -23,8 +23,6 @@ declare(strict_types=1);
namespace Tests\integration\Api\Autocomplete;
use Laravel\Passport\Passport;
use Log;
use Tests\integration\TestCase;
/**
@@ -32,33 +30,16 @@ use Tests\integration\TestCase;
*/
class AccountControllerTest extends TestCase
{
/**
*
*/
public function setUp(): void
{
parent::setUp();
Passport::actingAs($this->user());
Log::info(sprintf('Now in %s.', get_class($this)));
}
/**
* @covers \FireflyIII\Api\V1\Controllers\Autocomplete\AccountController
* @runInSeparateProcess
*/
public function testAccounts(): void
public function testGivenAnUnauthenticatedRequestWhenCallingTheAccountsEndpointThenReturns401HttpCode(): void
{
// test API
$response = $this->get(route('api.v1.autocomplete.accounts'), ['Accept' => 'application/json']);
$response->assertStatus(200);
$response->assertStatus(401);
$response->assertHeader('Content-Type', 'application/json');
$response->assertSee('Checking Account');
}
/**
*
*/
public function testBasic(): void
{
$this->assertTrue(true);
$response->assertContent('{"message":"Unauthenticated","exception":"AuthenticationException"}');
}
}