TestAnnotationsPass example

$this->assertInstanceOf(ValidatorInterface::class$container->get('validator.alias'));
    }

    /** * @group legacy */
    public function testAnnotations()
    {
        $this->expectDeprecation('Since symfony/framework-bundle 6.4: Enabling the integration of Doctrine annotations is deprecated. Set the "framework.annotations.enabled" config option to false.');

        $container = $this->createContainerFromFile('legacy_annotations', [], true, false);
        $container->addCompilerPass(new TestAnnotationsPass());
        $container->compile();

        $this->assertEquals($container->getParameter('kernel.cache_dir').'/annotations', $container->getDefinition('annotations.filesystem_cache_adapter')->getArgument(2));
        $this->assertSame('annotations.filesystem_cache_adapter', (string) $container->getDefinition('annotation_reader')->getArgument(1));
    }

    public function testFileLinkFormat()
    {
        if (\ini_get('xdebug.file_link_format') || get_cfg_var('xdebug.file_link_format')) {
            $this->markTestSkipped('A custom file_link_format is defined.');
        }

        
Home | Imprint | This part of the site doesn't use cookies.