Skip to content

Commit

Permalink
Organize?
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy Segall committed Jan 21, 2015
1 parent ceaaa0f commit 8c21f2d
Showing 1 changed file with 65 additions and 65 deletions.
130 changes: 65 additions & 65 deletions message.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,70 @@
<?php

/**
* Testing the arguments handler for messages.
*/
class MessageArgumentsTestCase extends DrupalWebTestCase {

/**
* @var \stdClass
*
* The user object.
*/
protected $user;

/**
* {@inheritdoc}
*/
public static function getInfo() {
return array(
'name' => 'Message arguments',
'description' => 'Test the Message and arguments handling.',
'group' => 'Message',
);
}

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

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

/**
* Testing ctools message arguments plugin.
*/
public function testCtoolsArguments() {
drupal_static_reset();
debug(entity_get_info());
// $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();
//
// $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.');
}

}

/**
* Test the Message CRUD handling.
*/
Expand Down Expand Up @@ -404,71 +469,6 @@ class MessageTokens extends DrupalWebTestCase {

}

/**
* Testing the arguments handler for messages.
*/
class MessageArgumentsTestCase extends DrupalWebTestCase {

/**
* @var \stdClass
*
* The user object.
*/
protected $user;

/**
* {@inheritdoc}
*/
public static function getInfo() {
return array(
'name' => 'Message arguments',
'description' => 'Test the Message and arguments handling.',
'group' => 'Message',
);
}

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

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

/**
* Testing ctools message arguments plugin.
*/
public function testCtoolsArguments() {
drupal_static_reset();
debug(entity_get_info());
// $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();
//
// $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.');
}

}

/**
* Test the Rules integration.
*/
Expand Down

0 comments on commit 8c21f2d

Please sign in to comment.