File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
tests/Unit/DependencyInjection Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 3737 */
3838class HttplugExtension extends Extension
3939{
40+ public const HTTPLUG_CLIENT_TAG = 'httplug.client ' ;
41+
4042 /**
4143 * Used to check is the VCR plugin is installed.
4244 *
@@ -419,6 +421,7 @@ function ($id) {
419421 ->addArgument ([
420422 'client_name ' => $ clientName ,
421423 ])
424+ ->addTag (self ::HTTPLUG_CLIENT_TAG )
422425 ;
423426
424427 if (is_bool ($ arguments ['public ' ])) {
Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ protected function getContainerExtensions()
3131 ];
3232 }
3333
34+ public function testConstants (): void
35+ {
36+ self ::assertSame ('httplug.client ' , HttplugExtension::HTTPLUG_CLIENT_TAG );
37+ }
38+
3439 public function testConfigLoadDefault ()
3540 {
3641 $ this ->load ();
@@ -452,6 +457,25 @@ public function testBatchClientCanBePublic()
452457 }
453458 }
454459
460+ public function testClientIsTaggedWithHttplugClientTag (): void
461+ {
462+ $ this ->load ([
463+ 'clients ' => [
464+ 'acme ' => null ,
465+ ],
466+ ]);
467+
468+ $ serviceId = 'httplug.client.acme ' ;
469+
470+ $ this ->assertContainerBuilderHasService ($ serviceId );
471+
472+ $ this ->assertTrue ($ this ->container ->getDefinition ($ serviceId )->hasTag (HttplugExtension::HTTPLUG_CLIENT_TAG ), sprintf (
473+ 'Failed asserting that client with service identifier "%s" has been tagged with "%s". ' ,
474+ $ serviceId ,
475+ HttplugExtension::HTTPLUG_CLIENT_TAG
476+ ));
477+ }
478+
455479 /**
456480 * @dataProvider provideVcrPluginConfig
457481 * @group vcr-plugin
You can’t perform that action at this time.
0 commit comments