Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/Reseller/StatsTest.php
Show All 24 Lines | class StatsTest extends TestCase | ||||
/** | /** | ||||
* Test charts (GET /api/v4/stats/chart/<chart>) | * Test charts (GET /api/v4/stats/chart/<chart>) | ||||
*/ | */ | ||||
public function testChart(): void | public function testChart(): void | ||||
{ | { | ||||
$user = $this->getTestUser('john@kolab.org'); | $user = $this->getTestUser('john@kolab.org'); | ||||
$admin = $this->getTestUser('jeroen@jeroen.jeroen'); | $admin = $this->getTestUser('jeroen@jeroen.jeroen'); | ||||
$reseller = $this->getTestUser('reseller@kolabnow.com'); | $reseller = $this->getTestUser('reseller@' . \config('app.domain')); | ||||
// Unauth access | // Unauth access | ||||
$response = $this->get("api/v4/stats/chart/discounts"); | $response = $this->get("api/v4/stats/chart/discounts"); | ||||
$response->assertStatus(401); | $response->assertStatus(401); | ||||
// Normal user | // Normal user | ||||
$response = $this->actingAs($user)->get("api/v4/stats/chart/discounts"); | $response = $this->actingAs($user)->get("api/v4/stats/chart/discounts"); | ||||
$response->assertStatus(403); | $response->assertStatus(403); | ||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |