You are here

protected function EckTestHelper::getEntityIdFromPath in Entity Construction Kit (ECK) 7.2

Extract an entity ID from its path.

Parameters

string $path: The path to examine; defaults to the current path.

Return value

int The ID of the requested entity path.

1 call to EckTestHelper::getEntityIdFromPath()
EckTestHelper::createEntity in tests/EckTestHelper.test
Create a test entity object.

File

tests/EckTestHelper.test, line 283
The EckTestHelper class.

Class

EckTestHelper
Helper logic for the other ECK tests.

Code

protected function getEntityIdFromPath($path = NULL) {
  if (empty($path)) {
    $path = $this
      ->getUrl();
  }

  // The ID will be the last portion of the URL.
  $parts = explode('/', $path);
  return array_pop($parts);
}