Exemplo n.º 1
0
 function test_find_template()
 {
     global $CONF;
     $module = new DummyModule();
     // Where to look for templates
     $path_default = $CONF['path_templates'];
     $path_specific = $CONF['path_test'] . 'templates/';
     // Not found
     $this->assertNull($module->find_template('notfound'));
     // Default path
     $this->assertEqual($module->find_template('inc-header'), $path_default . 'inc-header.php');
     // Specific path
     $this->assertEqual($module->find_template('info_default'), $path_specific . 'info_default.php');
     // Known content type
     $this->assertEqual($module->find_template('record', 'xspf'), $path_default . 'record.xspf.php');
     // HTML/unknown content type
     $this->assertEqual($module->find_template('record', 'html'), $path_default . 'record.php');
     $this->assertEqual($module->find_template('record', 'foobar'), $path_default . 'record.php');
 }