create(); $this->actingAs($user); $csvData = "name_de,name_en,icon,color,description_de,description_en,sort_order,is_active,event_types\nGlück,Joy,😊,#FFD700,Gefühl des Glücks,Feeling of joy,1,1,wedding|birthday"; $csvFile = UploadedFile::fake()->createWithContent('emotions.csv', $csvData); Livewire::test(ImportEmotions::class) ->set('file', $csvFile->getRealPath()) ->call('doImport'); $this->assertDatabaseHas('emotions', [ 'name' => json_encode(['de' => 'Glück', 'en' => 'Joy']), 'icon' => '😊', 'color' => '#FFD700', 'description' => json_encode(['de' => 'Gefühl des Glücks', 'en' => 'Feeling of joy']), 'sort_order' => 1, 'is_active' => 1, ]); $emotion = Emotion::where('name->de', 'Glück')->first(); $this->assertNotNull($emotion); } }