protected function PathautoTestHelper::entity_uri in Pathauto 6
Same name and namespace in other branches
- 6.2 pathauto.test \PathautoTestHelper::entity_uri()
Backport of Drupal 7's entity_uri() function.
5 calls to PathautoTestHelper::entity_uri()
File
- ./
pathauto.test, line 84 - Functionality tests for Pathauto.
Class
- PathautoTestHelper
- Helper test class with some added functions for testing.
Code
protected function entity_uri($entity_type, $entity) {
$uri = array();
switch ($entity_type) {
case 'node':
$uri['path'] = 'node/' . $entity->nid;
break;
case 'taxonomy_term':
$uri['path'] = taxonomy_term_path($entity);
break;
case 'user':
$uri['path'] = 'user/' . $entity->uid;
break;
default:
return $this
->fail(t('Unknown entity @type.', array(
'@type' => $entity_type,
)));
}
return $uri;
}