You are here

public function DataLayerUnitTests::setupMockEntityInfo in dataLayer 7

Setup Mock Entity Info.

1 call to DataLayerUnitTests::setupMockEntityInfo()
DataLayerUnitTests::setupMockEntityTerms in tests/datalayer.unit.test
Setup Mock Entity Terms.

File

tests/datalayer.unit.test, line 261
Tests the functionality of the DataLayer module.

Class

DataLayerUnitTests
@file Tests the functionality of the DataLayer module.

Code

public function setupMockEntityInfo() {
  $entity_info =& drupal_static('entity_get_info');
  $entity_info = array(
    'node' => array(
      'entity keys' => array(
        'id' => 'nid',
        'revision' => 'vid',
        'bundle' => 'type',
        'label' => 'title',
        'language' => 'language',
      ),
    ),
    'taxonomy_term' => array(
      'controller class' => 'TaxonomyTermController',
      'base table' => 'taxonomy_term_data',
      'uri callback' => 'taxonomy_term_uri',
      'entity keys' => array(
        'id' => 'tid',
        'bundle' => 'vocabulary_machine_name',
        'label' => 'name',
        'revision' => '',
      ),
      'bundles' => array(
        'tags' => array(
          'label' => 'Tags',
          'admin' => array(
            'path' => 'admin/structure/taxonomy/%taxonomy_vocabulary_machine_name',
            'real path' => 'admin/structure/taxonomy/tags',
            'bundle argument' => 3,
            'access arguments' => array(
              0 => 'administer taxonomy',
            ),
          ),
        ),
      ),
    ),
  );
}