"Fossies" - the Fresh Open Source Software Archive

Member "symfony-3.4.28/src/Symfony/Component/Form/Tests/AbstractExtensionTest.php" (28 May 2019, 1121 Bytes) of package /linux/www/symfony-3.4.28.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 the Symfony package.
    5  *
    6  * (c) Fabien Potencier <fabien@symfony.com>
    7  *
    8  * For the full copyright and license information, please view the LICENSE
    9  * file that was distributed with this source code.
   10  */
   11 
   12 namespace Symfony\Component\Form\Tests;
   13 
   14 use PHPUnit\Framework\TestCase;
   15 use Symfony\Component\Form\AbstractExtension;
   16 use Symfony\Component\Form\Tests\Fixtures\FooType;
   17 
   18 class AbstractExtensionTest extends TestCase
   19 {
   20     public function testHasType()
   21     {
   22         $loader = new ConcreteExtension();
   23         $this->assertTrue($loader->hasType('Symfony\Component\Form\Tests\Fixtures\FooType'));
   24         $this->assertFalse($loader->hasType('foo'));
   25     }
   26 
   27     public function testGetType()
   28     {
   29         $loader = new ConcreteExtension();
   30         $this->assertInstanceOf('Symfony\Component\Form\Tests\Fixtures\FooType', $loader->getType('Symfony\Component\Form\Tests\Fixtures\FooType'));
   31     }
   32 }
   33 
   34 class ConcreteExtension extends AbstractExtension
   35 {
   36     protected function loadTypes()
   37     {
   38         return [new FooType()];
   39     }
   40 
   41     protected function loadTypeGuesser()
   42     {
   43     }
   44 }