AjglBreakpointTwigExtensionExtensionTest.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /*
  3. * AJGL Breakpoint Twig Extension Component
  4. *
  5. * Copyright (C) Antonio J. García Lagar <aj@garcialagar.es>
  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 Ajgl\Twig\Extension\Tests\SymfonyBundle\DependencyInjection;
  11. use Ajgl\Twig\Extension\SymfonyBundle\DependencyInjection\AjglBreakpointTwigExtensionExtension;
  12. use PHPUnit\Framework\TestCase;
  13. use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
  14. use Symfony\Component\DependencyInjection\ContainerBuilder;
  15. /**
  16. * @author Antonio J. García Lagar <aj@garcialagar.es>
  17. */
  18. class AjglBreakpointTwigExtensionExtensionTest extends TestCase
  19. {
  20. use SetUpTearDownTrait;
  21. /**
  22. * @var ContainerBuilder
  23. */
  24. protected $container;
  25. /**
  26. * @var AjglBreakpointTwigExtensionExtension
  27. */
  28. protected $extension;
  29. protected function doSetUp()
  30. {
  31. $this->container = new ContainerBuilder();
  32. $this->extension = new AjglBreakpointTwigExtensionExtension();
  33. }
  34. public function testTwigExtensionsDefinition()
  35. {
  36. $this->extension->load([], $this->container);
  37. $this->assertTrue($this->container->hasDefinition('ajgl_twig_extension.breakpoint'));
  38. $definition = $this->container->getDefinition('ajgl_twig_extension.breakpoint');
  39. $this->assertSame(
  40. 'Ajgl\Twig\Extension\BreakpointExtension',
  41. $definition->getClass()
  42. );
  43. $this->assertNotNull($definition->getTag('twig.extension'));
  44. }
  45. }