"Fossies" - the Fresh Open Source Software Archive

Member "contao-4.4.48/core-bundle/tests/DependencyInjection/Compiler/AddImagineClassPassTest.php" (2 Apr 2020, 1127 Bytes) of package /linux/www/contao-4.4.48.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 <?php
    2 
    3 /*
    4  * This file is part of Contao.
    5  *
    6  * (c) Leo Feyer
    7  *
    8  * @license LGPL-3.0-or-later
    9  */
   10 
   11 namespace Contao\CoreBundle\Tests\DependencyInjection\Compiler;
   12 
   13 use Contao\CoreBundle\DependencyInjection\Compiler\AddImagineClassPass;
   14 use Contao\CoreBundle\Tests\TestCase;
   15 use Symfony\Component\DependencyInjection\ContainerBuilder;
   16 use Symfony\Component\DependencyInjection\Definition;
   17 
   18 /**
   19  * Tests the AddImagineClassPass class.
   20  *
   21  * @author Leo Feyer <http://github.com/leofeyer>
   22  */
   23 class AddImagineClassPassTest extends TestCase
   24 {
   25     /**
   26      * Tests adding the Imagine class.
   27      */
   28     public function testAddsTheImagineClass()
   29     {
   30         $container = new ContainerBuilder();
   31         $container->setDefinition('contao.image.imagine', new Definition());
   32 
   33         $pass = new AddImagineClassPass();
   34         $pass->process($container);
   35 
   36         $this->assertContains(
   37             $container->getDefinition('contao.image.imagine')->getClass(),
   38             [
   39                 'Imagine\Gd\Imagine',
   40                 'Imagine\Gmagick\Imagine',
   41                 'Imagine\Imagick\Imagine',
   42             ]
   43         );
   44     }
   45 }