| @@ 406-423 (lines=18) @@ | ||
| 403 | $this->assertFalse($this->container->getDefinition('httplug.client.acme.batch_client')->isPublic()); |
|
| 404 | } |
|
| 405 | ||
| 406 | public function testClientCanBePublic(): void |
|
| 407 | { |
|
| 408 | $this->load([ |
|
| 409 | 'clients' => [ |
|
| 410 | 'acme' => [ |
|
| 411 | 'public' => true, |
|
| 412 | ], |
|
| 413 | ], |
|
| 414 | ]); |
|
| 415 | ||
| 416 | $this->assertContainerBuilderHasService('httplug.client.acme'); |
|
| 417 | $this->assertTrue($this->container->getDefinition('httplug.client.acme')->isPublic()); |
|
| 418 | ||
| 419 | if (version_compare(Kernel::VERSION, '3.4', '>=')) { |
|
| 420 | // Symfony made services private by default starting from 3.4 |
|
| 421 | $this->assertFalse($this->container->getDefinition('httplug.client.acme')->isPrivate()); |
|
| 422 | } |
|
| 423 | } |
|
| 424 | ||
| 425 | public function testFlexibleClientCanBePublic(): void |
|
| 426 | { |
|
| @@ 425-443 (lines=19) @@ | ||
| 422 | } |
|
| 423 | } |
|
| 424 | ||
| 425 | public function testFlexibleClientCanBePublic(): void |
|
| 426 | { |
|
| 427 | $this->load([ |
|
| 428 | 'clients' => [ |
|
| 429 | 'acme' => [ |
|
| 430 | 'public' => true, |
|
| 431 | 'flexible_client' => true, |
|
| 432 | ], |
|
| 433 | ], |
|
| 434 | ]); |
|
| 435 | ||
| 436 | $this->assertContainerBuilderHasService('httplug.client.acme'); |
|
| 437 | $this->assertTrue($this->container->getDefinition('httplug.client.acme.flexible')->isPublic()); |
|
| 438 | ||
| 439 | if (version_compare(Kernel::VERSION, '3.4', '>=')) { |
|
| 440 | // Symfony made services private by default starting from 3.4 |
|
| 441 | $this->assertFalse($this->container->getDefinition('httplug.client.acme.flexible')->isPrivate()); |
|
| 442 | } |
|
| 443 | } |
|
| 444 | ||
| 445 | public function testHttpMethodsClientCanBePublic(): void |
|
| 446 | { |
|
| @@ 445-463 (lines=19) @@ | ||
| 442 | } |
|
| 443 | } |
|
| 444 | ||
| 445 | public function testHttpMethodsClientCanBePublic(): void |
|
| 446 | { |
|
| 447 | $this->load([ |
|
| 448 | 'clients' => [ |
|
| 449 | 'acme' => [ |
|
| 450 | 'public' => true, |
|
| 451 | 'http_methods_client' => true, |
|
| 452 | ], |
|
| 453 | ], |
|
| 454 | ]); |
|
| 455 | ||
| 456 | $this->assertContainerBuilderHasService('httplug.client.acme'); |
|
| 457 | $this->assertTrue($this->container->getDefinition('httplug.client.acme.http_methods')->isPublic()); |
|
| 458 | ||
| 459 | if (version_compare(Kernel::VERSION, '3.4', '>=')) { |
|
| 460 | // Symfony made services private by default starting from 3.4 |
|
| 461 | $this->assertFalse($this->container->getDefinition('httplug.client.acme.http_methods')->isPrivate()); |
|
| 462 | } |
|
| 463 | } |
|
| 464 | ||
| 465 | public function testBatchClientCanBePublic(): void |
|
| 466 | { |
|
| @@ 465-483 (lines=19) @@ | ||
| 462 | } |
|
| 463 | } |
|
| 464 | ||
| 465 | public function testBatchClientCanBePublic(): void |
|
| 466 | { |
|
| 467 | $this->load([ |
|
| 468 | 'clients' => [ |
|
| 469 | 'acme' => [ |
|
| 470 | 'public' => true, |
|
| 471 | 'batch_client' => true, |
|
| 472 | ], |
|
| 473 | ], |
|
| 474 | ]); |
|
| 475 | ||
| 476 | $this->assertContainerBuilderHasService('httplug.client.acme'); |
|
| 477 | $this->assertTrue($this->container->getDefinition('httplug.client.acme.batch_client')->isPublic()); |
|
| 478 | ||
| 479 | if (version_compare(Kernel::VERSION, '3.4', '>=')) { |
|
| 480 | // Symfony made services private by default starting from 3.4 |
|
| 481 | $this->assertFalse($this->container->getDefinition('httplug.client.acme.batch_client')->isPrivate()); |
|
| 482 | } |
|
| 483 | } |
|
| 484 | ||
| 485 | public function testClientIsTaggedWithHttplugClientTag(): void |
|
| 486 | { |
|