$m->getName(), $reflection->getMethods()); foreach ([ 'getId', 'getLabel', 'getChannels', 'getChannelLabels', 'getRenderHint', 'supportsPurpose', 'isAvailable', 'requestChallenge', 'verify', 'cancel', 'getSettingsSchema', 'withConfig', ] as $expected) { $this->assertContains($expected, $methods, "Interface must declare {$expected}()."); } } public function test_mail_provider_fulfills_contract(): void { $provider = $this->app->make(MailIdentityProvider::class); $this->assertInstanceOf(IdentityVerificationInterface::class, $provider); $this->assertIsString($provider->getId()); $this->assertIsString($provider->getLabel()); $this->assertIsArray($provider->getChannels()); $this->assertIsArray($provider->getChannelLabels()); $this->assertArrayHasKey('email', $provider->getChannelLabels()); $this->assertIsString($provider->getRenderHint()); $this->assertIsBool($provider->supportsPurpose('signup')); $this->assertIsBool($provider->isAvailable()); $this->assertIsArray($provider->getSettingsSchema()); } public function test_with_config_returns_new_instance(): void { $provider = $this->app->make(MailIdentityProvider::class); $configured = $provider->withConfig(['code_length' => 8]); $this->assertInstanceOf(IdentityVerificationInterface::class, $configured); $this->assertNotSame($provider, $configured); } }