You are here

function RegistrationTestCase::entityLastId in Entity Registration 7

Same name and namespace in other branches
  1. 8.2 tests/registration.test \RegistrationTestCase::entityLastId()
  2. 7.2 tests/registration.test \RegistrationTestCase::entityLastId()
1 call to RegistrationTestCase::entityLastId()
RegistrationStandardTestCase::testRegistrationForm in tests/registration.test
Tests for the registration add/edit form.

File

tests/registration.test, line 51
Tests for the Registration module

Class

RegistrationTestCase
@file Tests for the Registration module

Code

function entityLastId($entity_type) {
  $query = new EntityFieldQuery();
  $result = $query
    ->entityCondition('entity_type', $entity_type)
    ->entityOrderBy('entity_id', 'DESC')
    ->range(0, 1)
    ->execute();
  return key($result[$entity_type]);
}