You are here

public function FileStorageTest::testlistAll in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/config/src/Tests/Storage/FileStorageTest.php \Drupal\config\Tests\Storage\FileStorageTest::testlistAll()

Tests the FileStorage::listAll method with a relative and absolute path.

File

core/modules/config/src/Tests/Storage/FileStorageTest.php, line 63
Contains \Drupal\config\Tests\Storage\FileStorageTest.

Class

FileStorageTest
Tests FileStorage operations.

Namespace

Drupal\config\Tests\Storage

Code

public function testlistAll() {
  $expected_files = array(
    'core.extension',
    'system.performance',
  );
  $config_files = $this->storage
    ->listAll();
  $this
    ->assertIdentical($config_files, $expected_files, 'Relative path, two config files found.');

  // Initialize FileStorage with absolute file path.
  $absolute_path = realpath($this->directory);
  $storage_absolute_path = new FileStorage($absolute_path);
  $config_files = $storage_absolute_path
    ->listAll();
  $this
    ->assertIdentical($config_files, $expected_files, 'Absolute path, two config files found.');
}