You are here

party_user.test in Party 8.2

Same filename and directory in other branches
  1. 7 modules/party_user/tests/party_user.test

Tests for the Party User module.

File

modules/party_user/tests/party_user.test
View source
<?php

/**
 * @file
 * Tests for the Party User module.
 */

/**
 * Party User Data Set and Access tests.
 *
 * @todo: Implement access tests.
 */
class PartyUserTestCase extends PartyBaseTestCase {

  /**
   * Privileged user account to carry out tests with.
   */
  protected $privileged_user;
  public static function getInfo() {
    return array(
      'name' => 'Party User',
      'description' => 'Party User Data Set and Access tests.',
      'group' => 'Party',
      'dependencies' => array(
        'email_confirm',
      ),
    );
  }

  /**
   * Prepare the site ready for tests.
   */
  public function setUp() {
    parent::setUp('party', 'party_user');

    // Enable any modules required for the test
    $this->privileged_user = $this
      ->drupalCreateUser(array(
      'administer crm settings',
      'administer parties',
    ));
    $this
      ->drupalLogin($this->privileged_user);
  }

  /**
   * Test whether the Data Set has been created and is shown in the ui.
   */
  public function testPartyUserDataSet() {

    // Assert that Data Set Info exists for the 'User account' data set.
    $info = party_get_data_set_info('user');
    $this
      ->assertFalse(empty($info));
    $this
      ->drupalGet('admin/community/datasets');

    // Assert that the 'User account' data set appears on the data sets page.
    $this
      ->assertRaw('User account');
  }

}

Classes

Namesort descending Description
PartyUserTestCase Party User Data Set and Access tests.