addTemplate('expected_cache_class', $templateName); self::assertSame('expected_cache_class', $registry->getCacheClassName($searchedName)); } public function provideNotationsMatchingTemplateName(): array { return [ ['index.html.twig', 'index.html.twig'], ['AcmeBundle::index.html.twig', '@Acme/index.html.twig'], ['@Acme/index.html.twig', 'AcmeBundle::index.html.twig'], ['AppBundle:DataProvider/GraduateJobs:job.xml.twig', '@App/DataProvider/GraduateJobs/job.xml.twig'], ['AppBundle:Emails/workflow_status:default_email.html.twig', 'AppBundle:Emails:workflow_status/default_email.html.twig'], ['AppBundle:Emails/workflow_status/foobar:default_email.html.twig', 'AppBundle:Emails:workflow_status/foobar/default_email.html.twig'], ['AppBundle:Emails/workflow_status:foobar/default_email.html.twig', 'AppBundle:Emails:workflow_status/foobar/default_email.html.twig'], ['AppBundle:Emails:workflow_status/foobar/default_email.html.twig', 'AppBundle:Emails/workflow_status:foobar/default_email.html.twig'], ['AppBundle:Emails/workflow_status/foobar:default_email.html.twig', 'AppBundle:Emails/workflow_status:foobar/default_email.html.twig'], ['AppBundle:Emails:workflow_status/foobar/default_email.html.twig', 'AppBundle:Emails/workflow_status/foobar:default_email.html.twig'], ['AppBundle:Emails/workflow_status:foobar/default_email.html.twig', 'AppBundle:Emails/workflow_status/foobar:default_email.html.twig'], ]; } public function testNotationNotMatchingTemplateName() { $registry = new CachedTemplatesRegistry(); $registry->addTemplate('index.html.twig', 'not_expected_cache_class'); self::expectException(CachedTemplateNotFoundException::class); $registry->getCacheClassName(''); } }