You are here

public function LibrariesWebTest::testLibrariesScanInfoFiles in Libraries API 8.3

Tests libraries_scan_info_files().

File

src/Tests/LibrariesWebTest.php, line 138

Class

LibrariesWebTest
Tests basic detection and loading of libraries.

Namespace

Drupal\libraries\Tests

Code

public function testLibrariesScanInfoFiles() {
  $expected = [
    'example_info_file' => (object) [
      'uri' => drupal_get_path('module', 'libraries') . '/tests/example/example_info_file.libraries.info.yml',
      'filename' => 'example_info_file.libraries.info.yml',
      'name' => 'example_info_file.libraries.info',
    ],
  ];
  $actual = libraries_scan_info_files();
  $this
    ->verbose('Expected:<pre>' . var_export($expected, TRUE) . '</pre>');
  $this
    ->verbose('Actual:<pre>' . var_export($actual, TRUE) . '</pre>');
  $this
    ->assertEqual($actual, $expected, 'libraries_scan_info_files() correctly finds the example info file.');
  $this
    ->verbose('<pre>' . var_export(libraries_scan_info_files(), TRUE) . '</pre>');
}