AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

TestCase.php 1.1KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace Tests;
  3. use App\Billing\SubscriptionGateway;
  4. use App\Commerce\Payments\MerchantAccounts;
  5. use App\Commerce\Payments\PaymentGateway;
  6. use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
  7. use Laravel\Fortify\Features;
  8. use Tests\Support\FakeGateway;
  9. use Tests\Support\FakeMerchantAccounts;
  10. use Tests\Support\FakeSubscriptionGateway;
  11. abstract class TestCase extends BaseTestCase
  12. {
  13. protected function setUp(): void
  14. {
  15. parent::setUp();
  16. // No test may ever talk to the real payment service. Tests that care replace these with their own.
  17. $this->app->instance(PaymentGateway::class, new FakeGateway);
  18. $this->app->instance(SubscriptionGateway::class, new FakeSubscriptionGateway);
  19. $this->app->instance(MerchantAccounts::class, new FakeMerchantAccounts);
  20. }
  21. protected function skipUnlessFortifyHas(string $feature, ?string $message = null): void
  22. {
  23. if (! Features::enabled($feature)) {
  24. $this->markTestSkipped($message ?? "Fortify feature [{$feature}] is not enabled.");
  25. }
  26. }
  27. }