Ejemplo n.º 1
0
 public function testLoad()
 {
     $dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . rand(111111, 999999);
     mkdir($dir, 0777, true);
     $loader = new ProjectTemplateLoader($varLoader = new ProjectTemplateLoaderVar(), $dir);
     $this->assertFalse($loader->load(new ehough_templating_TemplateReference('foo', 'php')), '->load() returns false if the embed loader is not able to load the template');
     $logger = $this->getMock('ehough_templating_test_MockLoggerInterface');
     $logger->expects($this->once())->method('debug')->with('Storing template "index" in cache');
     $loader->setLogger($logger);
     $loader->load(new ehough_templating_TemplateReference('index'));
     $logger = $this->getMock('ehough_templating_test_MockLoggerInterface');
     $logger->expects($this->once())->method('debug')->with('Fetching template "index" from cache');
     $loader->setLogger($logger);
     $loader->load(new ehough_templating_TemplateReference('index'));
 }