| @@ 374-391 (lines=18) @@ | ||
| 371 | $this->assertFalse($this->container->getDefinition('httplug.client.acme.batch_client')->isPublic()); |
|
| 372 | } |
|
| 373 | ||
| 374 | public function testClientCanBePublic() |
|
| 375 | { |
|
| 376 | $this->load([ |
|
| 377 | 'clients' => [ |
|
| 378 | 'acme' => [ |
|
| 379 | 'public' => true, |
|
| 380 | ], |
|
| 381 | ], |
|
| 382 | ]); |
|
| 383 | ||
| 384 | $this->assertContainerBuilderHasService('httplug.client.acme'); |
|
| 385 | $this->assertTrue($this->container->getDefinition('httplug.client.acme')->isPublic()); |
|
| 386 | ||
| 387 | if (version_compare(Kernel::VERSION, '3.4', '>=')) { |
|
| 388 | // Symfony made services private by default starting from 3.4 |
|
| 389 | $this->assertFalse($this->container->getDefinition('httplug.client.acme')->isPrivate()); |
|
| 390 | } |
|
| 391 | } |
|
| 392 | ||
| 393 | public function testFlexibleClientCanBePublic() |
|
| 394 | { |
|
| @@ 393-411 (lines=19) @@ | ||
| 390 | } |
|
| 391 | } |
|
| 392 | ||
| 393 | public function testFlexibleClientCanBePublic() |
|
| 394 | { |
|
| 395 | $this->load([ |
|
| 396 | 'clients' => [ |
|
| 397 | 'acme' => [ |
|
| 398 | 'public' => true, |
|
| 399 | 'flexible_client' => true, |
|
| 400 | ], |
|
| 401 | ], |
|
| 402 | ]); |
|
| 403 | ||
| 404 | $this->assertContainerBuilderHasService('httplug.client.acme'); |
|
| 405 | $this->assertTrue($this->container->getDefinition('httplug.client.acme.flexible')->isPublic()); |
|
| 406 | ||
| 407 | if (version_compare(Kernel::VERSION, '3.4', '>=')) { |
|
| 408 | // Symfony made services private by default starting from 3.4 |
|
| 409 | $this->assertFalse($this->container->getDefinition('httplug.client.acme.flexible')->isPrivate()); |
|
| 410 | } |
|
| 411 | } |
|
| 412 | ||
| 413 | public function testHttpMethodsClientCanBePublic() |
|
| 414 | { |
|
| @@ 413-431 (lines=19) @@ | ||
| 410 | } |
|
| 411 | } |
|
| 412 | ||
| 413 | public function testHttpMethodsClientCanBePublic() |
|
| 414 | { |
|
| 415 | $this->load([ |
|
| 416 | 'clients' => [ |
|
| 417 | 'acme' => [ |
|
| 418 | 'public' => true, |
|
| 419 | 'http_methods_client' => true, |
|
| 420 | ], |
|
| 421 | ], |
|
| 422 | ]); |
|
| 423 | ||
| 424 | $this->assertContainerBuilderHasService('httplug.client.acme'); |
|
| 425 | $this->assertTrue($this->container->getDefinition('httplug.client.acme.http_methods')->isPublic()); |
|
| 426 | ||
| 427 | if (version_compare(Kernel::VERSION, '3.4', '>=')) { |
|
| 428 | // Symfony made services private by default starting from 3.4 |
|
| 429 | $this->assertFalse($this->container->getDefinition('httplug.client.acme.http_methods')->isPrivate()); |
|
| 430 | } |
|
| 431 | } |
|
| 432 | ||
| 433 | public function testBatchClientCanBePublic() |
|
| 434 | { |
|
| @@ 433-451 (lines=19) @@ | ||
| 430 | } |
|
| 431 | } |
|
| 432 | ||
| 433 | public function testBatchClientCanBePublic() |
|
| 434 | { |
|
| 435 | $this->load([ |
|
| 436 | 'clients' => [ |
|
| 437 | 'acme' => [ |
|
| 438 | 'public' => true, |
|
| 439 | 'batch_client' => true, |
|
| 440 | ], |
|
| 441 | ], |
|
| 442 | ]); |
|
| 443 | ||
| 444 | $this->assertContainerBuilderHasService('httplug.client.acme'); |
|
| 445 | $this->assertTrue($this->container->getDefinition('httplug.client.acme.batch_client')->isPublic()); |
|
| 446 | ||
| 447 | if (version_compare(Kernel::VERSION, '3.4', '>=')) { |
|
| 448 | // Symfony made services private by default starting from 3.4 |
|
| 449 | $this->assertFalse($this->container->getDefinition('httplug.client.acme.batch_client')->isPrivate()); |
|
| 450 | } |
|
| 451 | } |
|
| 452 | } |
|
| 453 | ||