Skip to content

Commit

Permalink
bbbb
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy Segall committed Jan 27, 2015
1 parent 51ea82f commit 9f999fd
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions tests/MessageArgumentsTestCase.test
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,36 @@ class MessageArgumentsTestCase extends DrupalWebTestCase {
function setUp() {
parent::setUp('message');

// $this->user = $this->drupalCreateUser();
$this->user = $this->drupalCreateUser();
}

/**
* Testing ctools message arguments plugin.
*/
public function testCtoolsArguments() {
// $uri = entity_uri('user', $this->user);
$uri = entity_uri('user', $this->user);
module_enable(array('message_test'));
message_type_create('message_test_arguments', array('message_text' => array(LANGUAGE_NONE => array(array('value' => 'Example text.')))))->save();
//
// $message = message_create('message_test_arguments', array('uid' => $this->user->uid));
// $message->save();

throw new Exception(serialize(message_get_message_arguments_plugin()));

// if (!$handler = message_get_message_arguments_handler($message)) {
// throw new Exception('No arguments handler was found for the Message example message type.');
// }
//
// $arguments = $handler->getArguments();
//
// $expected_arguments = array(
// '@name' => $this->user->name,
// '%time' => format_date($message->timestamp),
// '!link' => l(t('link'), $uri['path'], array('absolute' => TRUE)),
// );
//
// // Verify we got the correct arguments.
// $this->assertEqual($arguments, $expected_arguments, 'The arguments plugin returned the expected values.');
$message_type = message_type_create('message_test_arguments', array('message_text' => array(LANGUAGE_NONE => array(array('value' => 'Example text.')))));
$message_type->save();

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


if (!$handler = message_get_message_arguments_handler($message)) {
throw new Exception('No arguments handler was found for the Message example message type.');
}

$arguments = $handler->getArguments();

$expected_arguments = array(
'@name' => $this->user->name,
'%time' => format_date($message->timestamp),
'!link' => l(t('link'), $uri['path'], array('absolute' => TRUE)),
);

// Verify we got the correct arguments.
$this->assertEqual($arguments, $expected_arguments, 'The arguments plugin returned the expected values.');
}

}

0 comments on commit 9f999fd

Please sign in to comment.