@@ -131,4 +131,49 @@ public function testCanOverrideBaseUrI($baseUri, $requestUri, $overrideBaseUri,
131131 $ this ->assertEquals ($ expectedHost , $ request ->getUri ()->getHost ());
132132 $ this ->assertEquals ($ expectedPath , $ request ->getUri ()->getPath ());
133133 }
134+
135+ public function testShouldAllowGetWithoutQuery ()
136+ {
137+ $ requestUri = 'v0/put/cats ' ;
138+ $ baseUri = 'http://someservice.com/api/ ' ;
139+
140+ $ mockHandler = new MockHandler ([
141+ new Response (200 , ['X-Foo ' => 'Bar ' ]),
142+ ]);
143+
144+ $ container = [];
145+ $ history = Middleware::history ($ container );
146+ $ stack = HandlerStack::create ($ mockHandler );
147+ $ stack ->push ($ history );
148+
149+ $ client = new Client (['handler ' => $ stack ]);
150+
151+ $ producer = $ this ->producer ;
152+ $ producer ->setHttpClient ($ client );
153+
154+ $ actionParams = [
155+ RestConfigurableProducer::REQUEST_NAME => 'someRequest ' ,
156+ RestConfigurableProducer::REQUEST_HTTP_VERB => 'GET ' ,
157+ RestConfigurableProducer::REQUEST_BODY => [],
158+ RestConfigurableProducer::REQUEST_URI => $ requestUri ,
159+ RestConfigurableProducer::DISPLAY_RESPONSE_ERROR => false ,
160+ ];
161+
162+ $ options = [
163+ RestConfigurableProtocol::OPTION_BASE_URI => $ baseUri ,
164+ RestConfigurableProtocol::OPTION_ENCODING => RestConfigurableProtocol::ENCODING_JSON ,
165+ ConfigurableWebserviceProtocol::OPTION_CONNECT_TIMEOUT => 10 ,
166+ ConfigurableWebserviceProtocol::OPTION_TIMEOUT => 10 ,
167+ RestConfigurableProtocol::OPTION_HEADERS => [],
168+ RestConfigurableProtocol::OPTION_AUTH => false ,
169+ ];
170+ $ context = [
171+ 'vars ' => [],
172+ 'msg ' => new Message (new SerializableThing (), [], new Context ()),
173+ 'exchange ' => new Exchange (),
174+ ];
175+
176+ $ response = $ producer ->executeStep (RestConfigurableProducer::STEP_REQUEST , $ actionParams , $ options , $ context );
177+ $ this ->assertTrue ($ response , 'The producer should return true to say it has completed the Request Step ' );
178+ }
134179}
0 commit comments