You are here

class EntityTest in Autoload 7.2

Same name and namespace in other branches
  1. 7 src/Tests/Unit/EntityTest.php \Drupal\autoload\Tests\Unit\EntityTest

Class EntityTest.

Hierarchy

  • class \Drupal\autoload\Tests\Unit\AutoloadTestBase extends \Drupal\autoload\Tests\Unit\DrupalWebTestCase

Expanded class hierarchy of EntityTest

File

src/Tests/Unit/EntityTest.php, line 8

Namespace

Drupal\autoload\Tests\Unit
View source
class EntityTest extends AutoloadTestBase {

  /**
   * {@inheritdoc}
   */
  protected static $modules = array(
    'autoload_test_entity_ui',
  );

  /**
   * {@inheritdoc}
   */
  public static function getInfo() {
    return static::info(t('Ensure autoloading is properly operable in entity hooks.'));
  }

  /**
   * {@inheritdoc}
   */
  public function test() {

    // The next error must not appear:
    // Error: Class 'Drupal\autoload_test_entity_ui\ViewsController' not found
    // in entity_views_data() (line 31 of sites/all/modules/entity/views/entity.
    // views.inc).
    $entity_info = entity_get_info('autoload_test_entity');
    $this
      ->assertTrue(class_exists($entity_info['views controller class']), 'Views controller class for entity loaded successfully.');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AutoloadTestBase::$autoloadFile protected property A path to file with the autoloading class map.
AutoloadTestBase::$profile protected property
AutoloadTestBase::info protected static function Returns an information about the test.
AutoloadTestBase::preloadRegistry protected function
AutoloadTestBase::setUp protected function
EntityTest::$modules protected static property Modules which should enabled for testing. Overrides AutoloadTestBase::$modules
EntityTest::getInfo public static function
EntityTest::test public function