StreamWrapperManagerTest.php in Drupal 8
File
core/tests/Drupal/KernelTests/Core/StreamWrapper/StreamWrapperManagerTest.php
View source
<?php
namespace Drupal\KernelTests\Core\StreamWrapper;
use Drupal\Core\StreamWrapper\StreamWrapperManager;
use Drupal\KernelTests\KernelTestBase;
class StreamWrapperManagerTest extends KernelTestBase {
protected $streamWrapperManager;
public static $modules = [
'system',
];
protected function setUp() {
parent::setUp();
$this->streamWrapperManager = \Drupal::service('stream_wrapper_manager');
}
public function testUriScheme($uri, $expected) {
$this
->assertSame($expected, StreamWrapperManager::getScheme($uri));
}
public function providerTestUriScheme() {
$data = [];
$data[] = [
'public://filename',
'public',
];
$data[] = [
'public://extra://',
'public',
];
$data[] = [
'invalid',
FALSE,
];
return $data;
}
}