You are here

heartbeat.rules.test in Heartbeat 6.4

File

modules/heartbeat_rules/tests/heartbeat.rules.test
View source
<?php

/**
 * @file
 *   Test class to test rules execution on heartbeat logging.
 */
require_once dirname(__FILE__) . '/../../../tests/heartbeatwebtestcase.inc';

/**
 * Class HeartbeatRulesTest
 *
 */
class HeartbeatRulesTest extends HeartbeatWebTestCase {

  /**
   * Implementation of getInfo().
   */
  function getInfo() {
    return array(
      'name' => t('Heartbeat rules test'),
      'description' => t('Test heartbeat logging functionality with rules'),
      'group' => t('Heartbeat'),
    );
  }

  /**
   * Implementation of setUp().
   */
  function setUp() {
    parent::setUp('token', 'rules', 'heartbeat', 'hrules');
  }

  /**
   * Tests if a heartbeat message is logged for an event.
   */
  function testHeartbeatLogger() {
    $this
      ->drupalLogin($this
      ->drupalCreateUser($this->testRoles));
    $page_node = $this
      ->drupalCreateNode(array(
      'type' => 'page',
      'title' => 'MyFirstPage',
    ));

    // Get a stream page and check if the page post appears in the heartbeat activity stream.
    $this
      ->drupalGet('heartbeat/publicheartbeat');
    $this
      ->assertText('MyFirstPage', t('The page title is displayed in the public heartbeat stream.'), t('Heartbeat'));
  }

}

Classes

Namesort descending Description
HeartbeatRulesTest Class HeartbeatRulesTest