| 1234567891011121314151617181920212223242526272829 |
- <?php
-
- namespace Tests;
-
- use App\Billing\SubscriptionGateway;
- use App\Commerce\Payments\PaymentGateway;
- use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
- use Laravel\Fortify\Features;
- use Tests\Support\FakeGateway;
- use Tests\Support\FakeSubscriptionGateway;
-
- abstract class TestCase extends BaseTestCase
- {
- protected function setUp(): void
- {
- parent::setUp();
-
- // No test may ever talk to the real payment service. Tests that care replace these with their own.
- $this->app->instance(PaymentGateway::class, new FakeGateway);
- $this->app->instance(SubscriptionGateway::class, new FakeSubscriptionGateway);
- }
-
- protected function skipUnlessFortifyHas(string $feature, ?string $message = null): void
- {
- if (! Features::enabled($feature)) {
- $this->markTestSkipped($message ?? "Fortify feature [{$feature}] is not enabled.");
- }
- }
- }
|