@@ -267,4 +267,117 @@ private function verifyProfilingDisabled()
267267 );
268268 }
269269 }
270+
271+ public function testClientShouldBePrivateByDefault ()
272+ {
273+ $ this ->load ([
274+ 'clients ' => [
275+ 'acme ' => [],
276+ ],
277+ ]);
278+
279+ $ this ->assertContainerBuilderHasService ('httplug.client.acme ' );
280+ $ this ->assertFalse ($ this ->container ->getDefinition ('httplug.client.acme ' )->isPublic ());
281+ }
282+
283+ public function testFlexibleClientShouldBePrivateByDefault ()
284+ {
285+ $ this ->load ([
286+ 'clients ' => [
287+ 'acme ' => [
288+ 'flexible_client ' => true ,
289+ ],
290+ ],
291+ ]);
292+
293+ $ this ->assertContainerBuilderHasService ('httplug.client.acme ' );
294+ $ this ->assertFalse ($ this ->container ->getDefinition ('httplug.client.acme.flexible ' )->isPublic ());
295+ }
296+
297+ public function testHttpMethodsClientShouldBePrivateByDefault ()
298+ {
299+ $ this ->load ([
300+ 'clients ' => [
301+ 'acme ' => [
302+ 'http_methods_client ' => true ,
303+ ],
304+ ],
305+ ]);
306+
307+ $ this ->assertContainerBuilderHasService ('httplug.client.acme ' );
308+ $ this ->assertFalse ($ this ->container ->getDefinition ('httplug.client.acme.http_methods ' )->isPublic ());
309+ }
310+
311+ public function testBatchClientShouldBePrivateByDefault ()
312+ {
313+ $ this ->load ([
314+ 'clients ' => [
315+ 'acme ' => [
316+ 'batch_client ' => true ,
317+ ],
318+ ],
319+ ]);
320+
321+ $ this ->assertContainerBuilderHasService ('httplug.client.acme ' );
322+ $ this ->assertFalse ($ this ->container ->getDefinition ('httplug.client.acme.batch_client ' )->isPublic ());
323+ }
324+
325+ public function testClientCanBePublic ()
326+ {
327+ $ this ->load ([
328+ 'clients ' => [
329+ 'acme ' => [
330+ 'public ' => true ,
331+ ],
332+ ],
333+ ]);
334+
335+ $ this ->assertContainerBuilderHasService ('httplug.client.acme ' );
336+ $ this ->assertTrue ($ this ->container ->getDefinition ('httplug.client.acme ' )->isPublic ());
337+ }
338+
339+ public function testFlexibleClientCanBePublic ()
340+ {
341+ $ this ->load ([
342+ 'clients ' => [
343+ 'acme ' => [
344+ 'public ' => true ,
345+ 'flexible_client ' => true ,
346+ ],
347+ ],
348+ ]);
349+
350+ $ this ->assertContainerBuilderHasService ('httplug.client.acme ' );
351+ $ this ->assertTrue ($ this ->container ->getDefinition ('httplug.client.acme.flexible ' )->isPublic ());
352+ }
353+
354+ public function testHttpMethodsClientCanBePublic ()
355+ {
356+ $ this ->load ([
357+ 'clients ' => [
358+ 'acme ' => [
359+ 'public ' => true ,
360+ 'http_methods_client ' => true ,
361+ ],
362+ ],
363+ ]);
364+
365+ $ this ->assertContainerBuilderHasService ('httplug.client.acme ' );
366+ $ this ->assertTrue ($ this ->container ->getDefinition ('httplug.client.acme.http_methods ' )->isPublic ());
367+ }
368+
369+ public function testBatchClientCanBePublic ()
370+ {
371+ $ this ->load ([
372+ 'clients ' => [
373+ 'acme ' => [
374+ 'public ' => true ,
375+ 'batch_client ' => true ,
376+ ],
377+ ],
378+ ]);
379+
380+ $ this ->assertContainerBuilderHasService ('httplug.client.acme ' );
381+ $ this ->assertTrue ($ this ->container ->getDefinition ('httplug.client.acme.batch_client ' )->isPublic ());
382+ }
270383}
0 commit comments