From 9f999fde9198c18a6ac3bef929a476ed42e32c3b Mon Sep 17 00:00:00 2001 From: Roy Segall Date: Tue, 27 Jan 2015 09:14:10 +0200 Subject: [PATCH] bbbb --- tests/MessageArgumentsTestCase.test | 46 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/MessageArgumentsTestCase.test b/tests/MessageArgumentsTestCase.test index e2b1cee..3b1a662 100644 --- a/tests/MessageArgumentsTestCase.test +++ b/tests/MessageArgumentsTestCase.test @@ -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.'); } }