Prevent stray requests in unit tests

This commit is contained in:
Constantin Graf
2024-12-02 17:36:07 +01:00
committed by Constantin Graf
parent 0c1f06face
commit 0ee0175f04
2 changed files with 3 additions and 0 deletions

View File

@@ -38,5 +38,6 @@
<env name="SESSION_DRIVER" value="array"/>
<env name="TELESCOPE_ENABLED" value="false"/>
<env name="AUDITING_ENABLED" value="true"/>
<env name="NEWSLETTER_URL" value="null"/>
</php>
</phpunit>

View File

@@ -11,6 +11,7 @@ use Carbon\CarbonImmutable;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Storage;
use Mockery\MockInterface;
@@ -25,6 +26,7 @@ abstract class TestCase extends BaseTestCase
parent::setUp();
Mail::fake();
LogFake::bind();
Http::preventStrayRequests();
$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));