build(); self::assertNotNull($container->get(Constants::HTTP_CLIENT)); self::assertInstanceOf(NullLogger::class, $container->get(Constants::LOGGER)); self::assertNotNull($container->get(StreamFactoryInterface::class)); self::assertNotNull($container->get(RequestFactoryInterface::class)); self::assertNotNull($container->get(UriFactoryInterface::class)); } public function testBuildWithDefinitions(): void { $client = new Client(); $logger = new StdoutLogger(); $factory = new Psr17Factory(); $container = ContainerBuilder::create() ->setEnv(Environment::TEST) ->setClient($client) ->setLogger($logger) ->setStreamFactory($factory) ->setRequestFactory($factory) ->setUriFactory($factory) ->build(); self::assertEquals($client, $container->get(Constants::HTTP_CLIENT)); self::assertEquals($logger, $container->get(Constants::LOGGER)); self::assertEquals($factory, $container->get(StreamFactoryInterface::class)); self::assertEquals($factory, $container->get(RequestFactoryInterface::class)); self::assertEquals($factory, $container->get(UriFactoryInterface::class)); } }