Skip to content

Commit

Permalink
fff
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy Segall committed Jan 26, 2015
1 parent 878d2eb commit 31dbdac
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions tests/MessageArgumentsTestCase.test
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,36 @@ class MessageArgumentsTestCase extends DrupalWebTestCase {
}

function setUp() {
parent::setUp('message', 'message_test');
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);

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();

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 = 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 31dbdac

Please sign in to comment.