skip to Main Content

How to move functions from closures to normal functions – PHP

I'm trying to make a pest test file easier to read. Currently, I've got some standard tests: test('can get subscribers latest subscription', function () { $this->seed(PlansTestSeeder::class); $this->seed(SubscriptionsTestSeeder::class); $this->assertDatabaseCount('plans', 2); $this->assertDatabaseCount('subscriptions', 0); Subscription::factory()->create([ "plan_id" => Plan::where("slug", "bronze")->first()->id ]); Subscription::factory()->create([ "plan_id" =>…

VIEW QUESTION
Back To Top
Search