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 37
37
*/
38
38
class HttplugExtension extends Extension
39
39
{
40
+ public const HTTPLUG_CLIENT_TAG = 'httplug.client ' ;
41
+
40
42
/**
41
43
* Used to check is the VCR plugin is installed.
42
44
*
@@ -419,6 +421,7 @@ function ($id) {
419
421
->addArgument ([
420
422
'client_name ' => $ clientName ,
421
423
])
424
+ ->addTag (self ::HTTPLUG_CLIENT_TAG )
422
425
;
423
426
424
427
if (is_bool ($ arguments ['public ' ])) {
Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ protected function getContainerExtensions()
31
31
];
32
32
}
33
33
34
+ public function testConstants (): void
35
+ {
36
+ self ::assertSame ('httplug.client ' , HttplugExtension::HTTPLUG_CLIENT_TAG );
37
+ }
38
+
34
39
public function testConfigLoadDefault ()
35
40
{
36
41
$ this ->load ();
@@ -452,6 +457,25 @@ public function testBatchClientCanBePublic()
452
457
}
453
458
}
454
459
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
+
455
479
/**
456
480
* @dataProvider provideVcrPluginConfig
457
481
* @group vcr-plugin
You can’t perform that action at this time.
0 commit comments