create(['portal' => Portal::Both, 'is_active' => true]); $handel->translations()->create(['locale' => 'de', 'name' => 'Handel', 'slug' => 'handel', 'description' => null]); $handel->translations()->create(['locale' => 'en', 'name' => 'Commerce', 'slug' => 'commerce', 'description' => 'Own text']); $this->artisan('categories:seed-descriptions', ['--dry-run' => true]) ->expectsOutputToContain('[Dry-Run] Nichts geschrieben.') ->assertSuccessful(); expect($handel->translations()->where('locale', 'de')->value('description'))->toBeNull(); $this->artisan('categories:seed-descriptions')->assertSuccessful(); expect($handel->translations()->where('locale', 'de')->value('description'))->toStartWith('Pressemitteilungen aus dem Handel') ->and($handel->translations()->where('locale', 'en')->value('description'))->toBe('Own text'); $this->artisan('categories:seed-descriptions', ['--force' => true])->assertSuccessful(); expect($handel->translations()->where('locale', 'en')->value('description'))->toStartWith('Press releases from retail'); }); test('every data file entry has a german and an english text within the admin limit', function () { /** @var array> $texts */ $texts = require database_path('seeders/data/category-descriptions.php'); expect($texts)->toHaveCount(14); foreach ($texts as $slug => $byLocale) { expect($byLocale)->toHaveKeys(['de', 'en']); expect(mb_strlen($byLocale['de']))->toBeLessThanOrEqual(1000); expect(mb_strlen($byLocale['en']))->toBeLessThanOrEqual(1000); } });