messaging_template.test in Messaging 6.3
File
tests/messaging_template.test
View source
<?php
class Messaging_Template_Tests extends MessagingTestCase {
function getInfo() {
return array(
'name' => '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,
));
}
function testMessagingTemplateAPI() {
global $language;
$user = $this
->drupalCreateUser();
$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}");
}
}
}