Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Controller/Admin/SkusTest.php
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | public function testIndex(): void | ||||
$response = $this->actingAs($user)->get("api/v4/skus"); | $response = $this->actingAs($user)->get("api/v4/skus"); | ||||
$response->assertStatus(403); | $response->assertStatus(403); | ||||
$response = $this->actingAs($admin)->get("api/v4/skus"); | $response = $this->actingAs($admin)->get("api/v4/skus"); | ||||
$response->assertStatus(200); | $response->assertStatus(200); | ||||
$json = $response->json(); | $json = $response->json(); | ||||
$this->assertCount(14, $json); | $this->assertCount(10, $json); | ||||
$this->assertSame(100, $json[0]['prio']); | $this->assertSame(100, $json[0]['prio']); | ||||
$this->assertSame($sku->id, $json[0]['id']); | $this->assertSame($sku->id, $json[0]['id']); | ||||
$this->assertSame($sku->title, $json[0]['title']); | $this->assertSame($sku->title, $json[0]['title']); | ||||
$this->assertSame($sku->name, $json[0]['name']); | $this->assertSame($sku->name, $json[0]['name']); | ||||
$this->assertSame($sku->description, $json[0]['description']); | $this->assertSame($sku->description, $json[0]['description']); | ||||
$this->assertSame($sku->cost, $json[0]['cost']); | $this->assertSame($sku->cost, $json[0]['cost']); | ||||
$this->assertSame($sku->units_free, $json[0]['units_free']); | $this->assertSame($sku->units_free, $json[0]['units_free']); | ||||
Show All 31 Lines |