You are here

public function SeekerTest::test in Autoload 7

Unit tests for auxiliary functions.

Overrides AuxiliaryTest::test

File

src/Tests/Unit/SeekerTest.php, line 29

Class

SeekerTest
Class SeekerTest.

Namespace

Drupal\autoload\Tests\Unit

Code

public function test() {
  $this
    ->assertClasses('Autoload', array(
    'Autoload\\Tests\\PSR0',
    'Autoload\\Tests\\PSR4',
    'Autoload\\Tests\\Example\\Test',
  ));
  $this
    ->assertClasses('AutoloadTests', array(
    'AutoloadTests\\PSR4',
  ));
  $this
    ->assertClasses('Drupal', array(
    'Drupal\\autoload_test_drupal\\PSR0',
    'Drupal\\autoload_test_drupal\\PSR4',
  ));
  foreach (autoload_seek_classes('Drupal', NULL, TRUE) as $class => $info) {
    $keys = array(
      'uri',
      'name',
      'path',
      'filename',
      'module_name',
      'module_path',
    );
    $this
      ->assertFalse(array_diff(array_keys((array) $info), $keys), 'Structure of file info is correct.');

    // No need to iterate through all of the classes.
    break;
  }
}