createRequest($method ?? static::TEST_METHOD, static::TEST_URI); } /** * @param string $body * * @return \Psr\Http\Message\RequestInterface */ protected static function getRequestWithBody(string $body): RequestInterface { return static::getPsr17Factory()->createRequest( RequestMethod::GET, static::TEST_URI )->withBody(self::getPsr17Factory()->createStream($body)); } /** * @return \Nyholm\Psr7\Factory\Psr17Factory */ protected static function getPsr17Factory(): Psr17Factory { if (null === static::$psr17Factory) { static::$psr17Factory = new Psr17Factory(); } return static::$psr17Factory; } protected static function getJsonSerializer(): SerializerInterface { return JsonSerializerFactory::create(); } protected static function getXmlSerializer(): SerializerInterface { return XmlSerializerFactory::create(); } }