class StreamWrapperManagerTest

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/KernelTests/Core/StreamWrapper/StreamWrapperManagerTest.php \Drupal\KernelTests\Core\StreamWrapper\StreamWrapperManagerTest
  2. 10 core/tests/Drupal/KernelTests/Core/StreamWrapper/StreamWrapperManagerTest.php \Drupal\KernelTests\Core\StreamWrapper\StreamWrapperManagerTest
  3. 9 core/tests/Drupal/KernelTests/Core/StreamWrapper/StreamWrapperManagerTest.php \Drupal\KernelTests\Core\StreamWrapper\StreamWrapperManagerTest
  4. 8.9.x core/tests/Drupal/KernelTests/Core/StreamWrapper/StreamWrapperManagerTest.php \Drupal\KernelTests\Core\StreamWrapper\StreamWrapperManagerTest

Tests Drupal\Core\StreamWrapper\StreamWrapperManager.

Attributes

#[CoversClass(StreamWrapperManager::class)] #[Group('File')] #[RunTestsInSeparateProcesses]

Hierarchy

Expanded class hierarchy of StreamWrapperManagerTest

File

core/tests/Drupal/KernelTests/Core/StreamWrapper/StreamWrapperManagerTest.php, line 17

Namespace

Drupal\KernelTests\Core\StreamWrapper
View source
class StreamWrapperManagerTest extends KernelTestBase {
  
  /**
   * The stream wrapper manager.
   *
   * @var \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface
   */
  protected $streamWrapperManager;
  
  /**
   * {@inheritdoc}
   */
  protected function setUp() : void {
    parent::setUp();
    $this->streamWrapperManager = \Drupal::service('stream_wrapper_manager');
  }
  
  /**
   * Tests uri scheme.
   *
   * @legacy-covers ::getScheme
   */
  public function testUriScheme($uri, $expected) : void {
    $this->assertSame($expected, StreamWrapperManager::getScheme($uri));
  }
  
  /**
   * Data provider.
   */
  public static function providerTestUriScheme() : array {
    $data = [];
    $data[] = [
      'public://filename',
      'public',
    ];
    $data[] = [
      'public://extra://',
      'public',
    ];
    $data[] = [
      'invalid',
      FALSE,
    ];
    return $data;
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.