public function testAddMockExtension() { $extension = $this->createMock('Apishka_Templater_ExtensionInterface'); $extension->expects($this->once())->method('getName')->will($this->returnValue('mock')); $loader = new Apishka_Templater_Loader_Array(array('page' => 'hey')); $twig = new Apishka_Templater_Environment($loader); $twig->addExtension($extension); $this->assertInstanceOf('Apishka_Templater_ExtensionInterface', $twig->getExtension('mock')); $this->assertTrue($twig->isTemplateFresh('page', time())); }