You are here

function WsfieldsStorageTestCase::testReadData in Web Service Data 7

File

modules/wsfields_storage/wsfields_storage.test, line 66
Describe the file

Class

WsfieldsStorageTestCase
@file Describe the file

Code

function testReadData() {

  // Login as admin
  $this
    ->drupalLogin($this->admin);

  // Get the list of users
  $query = new EntityFieldQuery();
  $users = $query
    ->entityCondition('entity_type', 'user')
    ->entityCondition('bundle', 'user')
    ->execute();
  $this
    ->drupalGet('admin/structure/wsconfig_types/manage/test_wsconfig_type');
  $this
    ->drupalGet('admin/content/wsconfig/wsconfig/1/edit');

  // Loop through all users and check that their title appears in
  // each corresponding user properly
  foreach ($users['user'] as $uid => $account) {
    if ($uid > 1) {
      $node = node_load($uid);
      $user = user_load($uid);
      $this
        ->drupalGet('/user/' . $user->uid . '/edit');
      $this
        ->drupalGet('/user/' . $user->uid);
      if (empty($user->field_nodetitle)) {
        $this
          ->verbose('User object contains empty "Node Title" field');
      }
      if ($node) {

        // This loads nodes from the parent site, not the simpletest instance. Need to rethink how to do this

        //$this->assertTrue($node->title == $user->field_nodetitle[LANGUAGE_NONE][0]['value'], t('Node title found in user account: @title', array('@title' => $node->title)));
      }
    }
  }
}