create('https://pds.example'); static::assertSame('https://pds.example', $client->getDefaultServiceUrl()); static::assertSame([], $client->get('com.atproto.repo.describeRepo', ['repo' => 'alice.example'])); } public function testCreateAcceptsAnExplicitLocalDevelopmentUrlPolicy(): void { $factory = new HttpFactory(); $clientFactory = new AtprotoClientFactory( new FactoryTestHttpClient(new Response(200, [], '{}')), $factory, $factory, ); $client = $clientFactory->create( 'http://localhost:2583', urlPolicy: new OutboundUrlPolicy(allowedDevelopmentHosts: ['localhost']), ); static::assertSame([], $client->get('com.atproto.repo.describeRepo', ['repo' => 'alice.test'])); } public function testCreateAuthenticatedBindsCredentialsToExplicitServiceUrl(): void { $factory = new HttpFactory(); $clientFactory = new AtprotoClientFactory( new FactoryTestHttpClient(new Response(200, [], '{}')), $factory, $factory, urlPolicy: new OutboundUrlPolicy(), ); $client = $clientFactory->createAuthenticated( new TestAuthenticatedSession('did:plc:abc', 'https://pds.example', 'token-value'), 'https://service.example', ); static::assertSame([], $client->get('com.atproto.server.getSession')); } }