Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/Admin/SkusTest.php
Show All 31 Lines | class SkusTest extends TestCase | ||||
/** | /** | ||||
* Test fetching SKUs list | * Test fetching SKUs list | ||||
*/ | */ | ||||
public function testIndex(): void | public function testIndex(): void | ||||
{ | { | ||||
$admin = $this->getTestUser('jeroen@jeroen.jeroen'); | $admin = $this->getTestUser('jeroen@jeroen.jeroen'); | ||||
$user = $this->getTestUser('john@kolab.org'); | $user = $this->getTestUser('john@kolab.org'); | ||||
$sku = Sku::where('title', 'mailbox')->first(); | $sku = Sku::withEnvTenantContext()->where('title', 'mailbox')->first(); | ||||
// Unauth access not allowed | // Unauth access not allowed | ||||
$response = $this->get("api/v4/skus"); | $response = $this->get("api/v4/skus"); | ||||
$response->assertStatus(401); | $response->assertStatus(401); | ||||
// User access not allowed on admin API | // User access not allowed on admin API | ||||
$response = $this->actingAs($user)->get("api/v4/skus"); | $response = $this->actingAs($user)->get("api/v4/skus"); | ||||
$response->assertStatus(403); | $response->assertStatus(403); | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |