create(['email' => uniqid('sf_', true).'@test.example', 'password' => bcrypt('password')]); $user->forceFill(['admin' => 7, 'confirmed' => true, 'active' => true, 'wizard' => 100, 'blocked' => false])->save(); $rawCat = SupplierCategory::query()->create(['name' => 'Kosmetikrohstoffe', 'pos' => 0]); $packCat = SupplierCategory::query()->create(['name' => 'Versandverpackungen', 'pos' => 1]); $raw = Supplier::factory()->create(['name' => 'AP49-RohstoffLieferant', 'active' => true]); $raw->supplierCategories()->attach($rawCat->id); $pack = Supplier::factory()->create(['name' => 'AP49-VerpackungsLieferant', 'active' => true]); $pack->supplierCategories()->attach($packCat->id); $ing = Ingredient::query()->create(['name' => 'AP49-INCI', 'active' => true, 'pos' => 0]); $this->actingAs($user->fresh(), 'user'); $this->get(route('admin_product_ingredient_edit', $ing->id)) ->assertSuccessful() ->assertSee('AP49-RohstoffLieferant') ->assertDontSee('AP49-VerpackungsLieferant'); });