'Messaging template', 'group' => 'Messaging', 'description' => 'Messaging template API functions' ); } function setUp() { parent::setUp('token', 'autoload', 'messaging', 'messaging_template', 'messaging_simple'); variable_set('messaging_method_simple', array('filter' => 0)); variable_set('messaging_method_debug', array('filter' => 0)); } /** * Exercise basic API functions */ function testMessagingTemplateAPI() { global $language; // Login user and test basic pages $user = $this->drupalCreateUser(); // Create template class and exercise the API $template = new Messaging_Template(); $defaults = messaging_template_get_defaults('messaging-template', $language); foreach (messaging_template_get_keys('messaging-template') as $key => $name) { $this->assertEqual($defaults[$key]->template, $template->text_part('messaging-template', $key), "Got the right template for $name"); $this->assertEqual($defaults[$key]->template, $template->text_part('messaging-template', $key, 'simple'), "Got the right template fallback for $name"); } } }