createMock(Translator::class); $extension = new Translation($translator); $filters = $extension->getFilters(); $this->assertExtensionExists('trans', [$translator, 'translate'], $filters); } /** * @covers \Engelsystem\Renderer\Twig\Extensions\Translation::getFunctions */ public function testGetFunctions(): void { /** @var Translator|MockObject $translator */ $translator = $this->createMock(Translator::class); $extension = new Translation($translator); $functions = $extension->getFunctions(); $this->assertExtensionExists('__', [$translator, 'translate'], $functions); $this->assertExtensionExists('_e', [$translator, 'translatePlural'], $functions); } }