You are here

class PartyUserTestCase in Party 8.2

Same name and namespace in other branches
  1. 7 modules/party_user/tests/party_user.test \PartyUserTestCase

Party User Data Set and Access tests.

@todo: Implement access tests.

Hierarchy

Expanded class hierarchy of PartyUserTestCase

File

modules/party_user/tests/party_user.test, line 12
Tests for the Party User module.

View source
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');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PartyBaseTestCase::createTestProfile2 public function Create a test profile2 type and return the profile2 type machine name.
PartyUserTestCase::$privileged_user protected property Privileged user account to carry out tests with.
PartyUserTestCase::getInfo public static function
PartyUserTestCase::setUp public function Prepare the site ready for tests.
PartyUserTestCase::testPartyUserDataSet public function Test whether the Data Set has been created and is shown in the ui.