Add tests for export endpoints

This commit is contained in:
Constantin Graf
2024-10-29 14:02:16 +01:00
committed by Constantin Graf
parent 5a1e05374c
commit 9a60e2b911
14 changed files with 675 additions and 88 deletions

View File

@@ -25,12 +25,7 @@ abstract class TestCase extends BaseTestCase
parent::setUp();
Mail::fake();
LogFake::bind();
$this->mock(BillingContract::class, function (MockInterface $mock): void {
$mock->shouldReceive('hasSubscription')->andReturn(false);
$mock->shouldReceive('hasTrial')->andReturn(false);
$mock->shouldReceive('getTrialUntil')->andReturn(null);
$mock->shouldReceive('isBlocked')->andReturn(false);
});
$this->actAsOrganizationWithoutSubscriptionAndWithoutTrial();
// Note: The following line can be used to test timezone edge cases.
// $this->travelTo(Carbon::now()->timezone('Europe/Vienna')->setHour(0)->setMinute(59)->setSecond(0));
}
@@ -89,4 +84,14 @@ abstract class TestCase extends BaseTestCase
$mock->shouldReceive('isBlocked')->andReturn(false);
});
}
protected function actAsOrganizationWithoutSubscriptionAndWithoutTrial(): void
{
$this->mock(BillingContract::class, function (MockInterface $mock): void {
$mock->shouldReceive('hasSubscription')->andReturn(false);
$mock->shouldReceive('hasTrial')->andReturn(false);
$mock->shouldReceive('getTrialUntil')->andReturn(null);
$mock->shouldReceive('isBlocked')->andReturn(false);
});
}
}