Skip to content

Commit fbabb48

Browse files
committed
Fix tests
1 parent 0e1325f commit fbabb48

4 files changed

Lines changed: 43 additions & 0 deletions

File tree

‎tests/Feature/CustomerAuthenticationTest.php‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,25 @@
22

33
namespace Tests\Feature;
44

5+
use App\Features\ShowAuthButtons;
56
use App\Models\User;
67
use Illuminate\Foundation\Testing\RefreshDatabase;
78
use Illuminate\Support\Facades\Hash;
9+
use Laravel\Pennant\Feature;
810
use Tests\TestCase;
911

1012
class CustomerAuthenticationTest extends TestCase
1113
{
1214
use RefreshDatabase;
1315

16+
protected function setUp(): void
17+
{
18+
parent::setUp();
19+
20+
// Enable the auth feature flag for all authentication tests
21+
Feature::define(ShowAuthButtons::class, true);
22+
}
23+
1424
public function test_customer_can_view_login_page(): void
1525
{
1626
$response = $this->get('/login');

‎tests/Feature/CustomerLicenseManagementTest.php‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,25 @@
22

33
namespace Tests\Feature;
44

5+
use App\Features\ShowAuthButtons;
56
use App\Models\License;
67
use App\Models\User;
78
use Illuminate\Foundation\Testing\RefreshDatabase;
9+
use Laravel\Pennant\Feature;
810
use Tests\TestCase;
911

1012
class CustomerLicenseManagementTest extends TestCase
1113
{
1214
use RefreshDatabase;
1315

16+
protected function setUp(): void
17+
{
18+
parent::setUp();
19+
20+
// Enable the auth feature flag for all license management tests
21+
Feature::define(ShowAuthButtons::class, true);
22+
}
23+
1424
public function test_customer_can_view_licenses_page(): void
1525
{
1626
$user = User::factory()->create();

‎tests/Feature/CustomerSubLicenseManagementTest.php‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,28 @@
22

33
namespace Tests\Feature;
44

5+
use App\Features\ShowAuthButtons;
56
use App\Models\License;
67
use App\Models\SubLicense;
78
use App\Models\User;
89
use Illuminate\Foundation\Testing\RefreshDatabase;
910
use Illuminate\Support\Facades\Http;
1011
use Illuminate\Support\Facades\Queue;
12+
use Laravel\Pennant\Feature;
1113
use Tests\TestCase;
1214

1315
class CustomerSubLicenseManagementTest extends TestCase
1416
{
1517
use RefreshDatabase;
1618

19+
protected function setUp(): void
20+
{
21+
parent::setUp();
22+
23+
// Enable the auth feature flag for all sub-license management tests
24+
Feature::define(ShowAuthButtons::class, true);
25+
}
26+
1727
public function test_customer_can_create_sub_license_when_license_supports_it(): void
1828
{
1929
Queue::fake();

‎tests/Feature/MobileRouteTest.php‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,24 @@
22

33
namespace Tests\Feature;
44

5+
use App\Features\ShowAuthButtons;
6+
use Illuminate\Foundation\Testing\RefreshDatabase;
7+
use Laravel\Pennant\Feature;
58
use PHPUnit\Framework\Attributes\Test;
69
use Tests\TestCase;
710

811
class MobileRouteTest extends TestCase
912
{
13+
use RefreshDatabase;
14+
15+
protected function setUp(): void
16+
{
17+
parent::setUp();
18+
19+
// Enable the auth feature flag since the pricing page might reference it
20+
Feature::define(ShowAuthButtons::class, false);
21+
}
22+
1023
#[Test]
1124
public function mobile_route_does_not_include_stripe_payment_links()
1225
{

0 commit comments

Comments
 (0)