ContainerParametersResourceTest.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\DependencyInjection\Tests\Config;
  11. use PHPUnit\Framework\TestCase;
  12. use Symfony\Component\DependencyInjection\Config\ContainerParametersResource;
  13. class ContainerParametersResourceTest extends TestCase
  14. {
  15. /** @var ContainerParametersResource */
  16. private $resource;
  17. protected function setUp()
  18. {
  19. $this->resource = new ContainerParametersResource(array('locales' => array('fr', 'en'), 'default_locale' => 'fr'));
  20. }
  21. public function testToString()
  22. {
  23. $this->assertSame('container_parameters_9893d3133814ab03cac3490f36dece77', (string) $this->resource);
  24. }
  25. public function testSerializeUnserialize()
  26. {
  27. $unserialized = unserialize(serialize($this->resource));
  28. $this->assertEquals($this->resource, $unserialized);
  29. }
  30. public function testGetParameters()
  31. {
  32. $this->assertSame(array('locales' => array('fr', 'en'), 'default_locale' => 'fr'), $this->resource->getParameters());
  33. }
  34. }