'admin-abo-delete-'.uniqid().'@test.com', 'password' => Hash::make('secret'), 'admin' => 2, 'lang' => 'de', ]); } function makeUserAbo(): UserAbo { return UserAbo::create([ 'user_id' => 1, 'shopping_user_id' => 1, 'is_for' => 'me', 'email' => 'kunde@example.com', 'payone_userid' => 123456, 'clearingtype' => 'cc', 'active' => true, 'status' => 2, 'abo_interval' => 5, 'next_date' => now()->addDays(10), ]); } it('löscht ein Abo soft über deleted_at', function () { $this->actingAs(adminDeleteUser()); $abo = makeUserAbo(); try { (new AboController(app(AboRepository::class)))->destroy($abo->id); } catch (RouteNotFoundException $e) { // Domain-spezifische Routen sind im Test-Kontext nicht registriert – erwartet. } expect(UserAbo::find($abo->id))->toBeNull(); expect(UserAbo::withTrashed()->find($abo->id)->deleted_at)->not->toBeNull(); }); it('wirft eine Not-Found-Exception für ein nicht existierendes Abo', function () { $this->actingAs(adminDeleteUser()); (new AboController(app(AboRepository::class)))->destroy(999999); })->throws(ModelNotFoundException::class);