Skip to content

Commit

Permalink
Maybe....
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy Segall committed Jan 25, 2015
1 parent 26b4219 commit 8ded72d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
1 change: 1 addition & 0 deletions message.module
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ define('MESSAGE_PURGE_LIMIT', 100);
function message_ctools_plugin_type() {
$plugins['message_arguments'] = array(
'classes' => array('class'),
'child plugins' => TRUE,
);

return $plugins;
Expand Down
20 changes: 6 additions & 14 deletions message.test
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class MessageArgumentsTestCase extends DrupalWebTestCase {
}

function setUp() {
parent::setUp(array('message'));
parent::setUp('message', 'message_example');

$this->user = $this->drupalCreateUser();
}
Expand All @@ -33,24 +33,16 @@ class MessageArgumentsTestCase extends DrupalWebTestCase {
* Testing ctools message arguments plugin.
*/
public function testCtoolsArguments() {
module_enable(array('message_example'));
$query = new EntityFieldQuery();
$reqults = $query
->entityCondition('entity_type', 'message_type')
->execute();

if ($reqults['message_type']) {
$foo = entity_load('message_type', array_keys($reqults['message_type']));
debug($foo);
}


$uri = entity_uri('user', $this->user);

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

$arguments = message_get_message_arguments_handler($message)->getArguments();
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,
Expand Down

0 comments on commit 8ded72d

Please sign in to comment.