InstanceType::Mastodon, 'url' => 'https://mastodon.social']); $client = $factory->for($instance); $this->assertInstanceOf(MastodonClient::class, $client); } public function test_it_resolves_lemmy_client_for_lemmy_instance_type(): void { $factory = app(FediverseClientFactory::class); $instance = new Instance(['type' => InstanceType::Lemmy, 'url' => 'https://lemmy.world']); $client = $factory->for($instance); $this->assertInstanceOf(LemmyClient::class, $client); } public function test_it_is_registered_as_a_singleton_in_the_container(): void { $a = $this->app->make(FediverseClientFactory::class); $b = $this->app->make(FediverseClientFactory::class); $this->assertSame($a, $b); } }