You are here

public function LinkitProfileUICRUDTestCase::testLoadAllProfiles in Linkit 7.3

Load all profiles.

File

test/linkit_profile.test, line 165
Tests for Linkit module.

Class

LinkitProfileUICRUDTestCase
Tests Linkit profile UI CRUD.

Code

public function testLoadAllProfiles() {

  // Create an user account so we can create profiles.
  $this->account = $this
    ->drupalCreateUser($this->admin_permissions);
  $this
    ->drupalLogin($this->account);

  // Create profiles that we will load.
  $this
    ->createProfile(array(
    'name' => 'test_1',
  ));
  $this
    ->createProfile(array(
    'name' => 'test_2',
  ));
  $this
    ->createProfile(array(
    'name' => 'test_3',
  ));

  // We have to clear the static variables here as we have in the
  // testLoadProfilesNoProfilesExists test function asked for profiles where
  // there were no profiles.
  drupal_static_reset('ctools_export_load_object');
  drupal_static_reset('ctools_export_load_object_all');

  // Load all profiles.
  $loaded_profiles = linkit_profile_load_all();
  $this
    ->assertEqual(count($loaded_profiles), 3, 'All profile were successfully loaded.');
}