Skip to content

Commit

Permalink
Push new test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy Segall committed Feb 1, 2015
1 parent fb0a995 commit 8780e7d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/MessageArgumentsTestCase.test
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ class MessageArgumentsTestCase extends DrupalWebTestCase {
public function testCtoolsArguments() {
$uri = entity_uri('user', $this->user);

// $text = '@name %time !link.';
// $message_type = message_type_create('message_test_arguments', array('message_text' => array(LANGUAGE_NONE => array(array('value' => $text)))));
// $message_type->save();

$message = message_create('example_arguments', array('uid' => $this->user->uid));
$message->save();

Expand All @@ -58,8 +54,11 @@ class MessageArgumentsTestCase extends DrupalWebTestCase {
// Verify we got the correct arguments.
$this->assertEqual($arguments, $expected_arguments, 'The arguments plugin returned the expected values.');

$text = $message->getText();
// Verifying we got the correct text.
$this->assertEqual(trim(strip_tags($message->getText())), trim(strip_tags(format_string($text, $expected_arguments))), 'The message text rendered as expected.');
foreach ($expected_arguments as $name => $argument) {
$this->assertTrue(strpos($text, $argument) !== FALSE, format_string('The rendered message contain the text for the argument @name', array('@name' => $name)));
}
}

}

0 comments on commit 8780e7d

Please sign in to comment.