diff --git a/core/modules/system/src/Tests/File/DirectoryTest.php b/core/modules/system/tests/src/Kernel/File/DirectoryTest.php similarity index 98% rename from core/modules/system/src/Tests/File/DirectoryTest.php rename to core/modules/system/tests/src/Kernel/File/DirectoryTest.php index 4c15a8e..90dcc80 100644 --- a/core/modules/system/src/Tests/File/DirectoryTest.php +++ b/core/modules/system/tests/src/Kernel/File/DirectoryTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\system\Tests\File\DirectoryTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; use Drupal\Component\PhpStorage\FileStorage; @@ -82,7 +82,7 @@ function testFileCheckDirectoryHandling() { $this->assertFalse(file_prepare_directory($directory, 0), 'Error reported for a non-writeable directory.', 'File'); // Test directory permission modification. - $this->settingsSet('file_chmod_directory', 0777); + $this->setSetting('file_chmod_directory', 0777); $this->assertTrue(file_prepare_directory($directory, FILE_MODIFY_PERMISSIONS), 'No error reported when making directory writeable.', 'File'); } diff --git a/core/modules/system/src/Tests/File/FileTestBase.php b/core/modules/system/tests/src/Kernel/File/FileTestBase.php similarity index 92% rename from core/modules/system/src/Tests/File/FileTestBase.php rename to core/modules/system/tests/src/Kernel/File/FileTestBase.php index 93e998d..dccbef2 100644 --- a/core/modules/system/src/Tests/File/FileTestBase.php +++ b/core/modules/system/tests/src/Kernel/File/FileTestBase.php @@ -5,9 +5,10 @@ * Contains \Drupal\system\Tests\File\FileTestBase. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; -use Drupal\simpletest\KernelTestBase; +use Drupal\Core\StreamWrapper\StreamWrapperInterface; +use Drupal\KernelTests\KernelTestBase; /** * Base class for file tests that adds some additional file specific @@ -39,10 +40,10 @@ protected function setUp() { parent::setUp(); $this->installConfig(array('system')); - $this->registerStreamWrapper('private', 'Drupal\Core\StreamWrapper\PrivateStream'); + $this->container->get('stream_wrapper_manager')->registerWrapper('private', 'Drupal\Core\StreamWrapper\PrivateStream', StreamWrapperInterface::NORMAL); if (isset($this->scheme)) { - $this->registerStreamWrapper($this->scheme, $this->classname); + $this->container->get('stream_wrapper_manager')->registerWrapper($this->scheme, $this->classname, StreamWrapperInterface::NORMAL); } } diff --git a/core/modules/system/src/Tests/File/MimeTypeTest.php b/core/modules/system/tests/src/Kernel/File/MimeTypeTest.php similarity index 98% rename from core/modules/system/src/Tests/File/MimeTypeTest.php rename to core/modules/system/tests/src/Kernel/File/MimeTypeTest.php index 6324bf0..8e217b8 100644 --- a/core/modules/system/src/Tests/File/MimeTypeTest.php +++ b/core/modules/system/tests/src/Kernel/File/MimeTypeTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\system\Tests\File\MimeTypeTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; /** * Tests filename mimetype detection. diff --git a/core/modules/system/src/Tests/File/NameMungingTest.php b/core/modules/system/tests/src/Kernel/File/NameMungingTest.php similarity index 98% rename from core/modules/system/src/Tests/File/NameMungingTest.php rename to core/modules/system/tests/src/Kernel/File/NameMungingTest.php index 3afd273..cbda7b3 100644 --- a/core/modules/system/src/Tests/File/NameMungingTest.php +++ b/core/modules/system/tests/src/Kernel/File/NameMungingTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\system\Tests\File\NameMungingTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; /** * Tests filename munging and unmunging. diff --git a/core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php b/core/modules/system/tests/src/Kernel/File/ReadOnlyStreamWrapperTest.php similarity index 99% rename from core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php rename to core/modules/system/tests/src/Kernel/File/ReadOnlyStreamWrapperTest.php index 4e43d3e..d2403b3 100644 --- a/core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php +++ b/core/modules/system/tests/src/Kernel/File/ReadOnlyStreamWrapperTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\system\Tests\File\ReadOnlyStreamWrapperTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; /** * Tests the read-only stream wrapper write functions. diff --git a/core/modules/system/src/Tests/File/RemoteFileDirectoryTest.php b/core/modules/system/tests/src/Kernel/File/RemoteFileDirectoryTest.php similarity index 94% rename from core/modules/system/src/Tests/File/RemoteFileDirectoryTest.php rename to core/modules/system/tests/src/Kernel/File/RemoteFileDirectoryTest.php index 12e3267..6b43b2d 100644 --- a/core/modules/system/src/Tests/File/RemoteFileDirectoryTest.php +++ b/core/modules/system/tests/src/Kernel/File/RemoteFileDirectoryTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\system\Tests\File\RemoteFileDirectoryTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; /** * Tests operations dealing with directories. diff --git a/core/modules/system/src/Tests/File/RemoteFileScanDirectoryTest.php b/core/modules/system/tests/src/Kernel/File/RemoteFileScanDirectoryTest.php similarity index 94% rename from core/modules/system/src/Tests/File/RemoteFileScanDirectoryTest.php rename to core/modules/system/tests/src/Kernel/File/RemoteFileScanDirectoryTest.php index 4f601f8..688764b 100644 --- a/core/modules/system/src/Tests/File/RemoteFileScanDirectoryTest.php +++ b/core/modules/system/tests/src/Kernel/File/RemoteFileScanDirectoryTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\system\Tests\File\RemoteFileScanDirectoryTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; /** * Tests the file_scan_directory() function. diff --git a/core/modules/system/src/Tests/File/RemoteFileUnmanagedCopyTest.php b/core/modules/system/tests/src/Kernel/File/RemoteFileUnmanagedCopyTest.php similarity index 94% rename from core/modules/system/src/Tests/File/RemoteFileUnmanagedCopyTest.php rename to core/modules/system/tests/src/Kernel/File/RemoteFileUnmanagedCopyTest.php index bf2a518..bb34e6f 100644 --- a/core/modules/system/src/Tests/File/RemoteFileUnmanagedCopyTest.php +++ b/core/modules/system/tests/src/Kernel/File/RemoteFileUnmanagedCopyTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\system\Tests\File\RemoteFileUnmanagedCopyTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; /** * Tests the unmanaged file copy function. diff --git a/core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php b/core/modules/system/tests/src/Kernel/File/RemoteFileUnmanagedDeleteRecursiveTest.php similarity index 95% rename from core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php rename to core/modules/system/tests/src/Kernel/File/RemoteFileUnmanagedDeleteRecursiveTest.php index 0eb8c2f..3bf86da 100644 --- a/core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php +++ b/core/modules/system/tests/src/Kernel/File/RemoteFileUnmanagedDeleteRecursiveTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\system\Tests\File\RemoteFileUnmanagedDeleteRecursiveTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; /** * Tests the unmanaged file delete recursive function. diff --git a/core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteTest.php b/core/modules/system/tests/src/Kernel/File/RemoteFileUnmanagedDeleteTest.php similarity index 94% rename from core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteTest.php rename to core/modules/system/tests/src/Kernel/File/RemoteFileUnmanagedDeleteTest.php index 0fc0368..78e99dc 100644 --- a/core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteTest.php +++ b/core/modules/system/tests/src/Kernel/File/RemoteFileUnmanagedDeleteTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\system\Tests\File\RemoteFileUnmanagedDeleteTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; /** * Tests the unmanaged file delete function. diff --git a/core/modules/system/src/Tests/File/RemoteFileUnmanagedMoveTest.php b/core/modules/system/tests/src/Kernel/File/RemoteFileUnmanagedMoveTest.php similarity index 94% rename from core/modules/system/src/Tests/File/RemoteFileUnmanagedMoveTest.php rename to core/modules/system/tests/src/Kernel/File/RemoteFileUnmanagedMoveTest.php index 41e2f6c..170ffb1 100644 --- a/core/modules/system/src/Tests/File/RemoteFileUnmanagedMoveTest.php +++ b/core/modules/system/tests/src/Kernel/File/RemoteFileUnmanagedMoveTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\system\Tests\File\RemoteFileUnmanagedMoveTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; /** * Tests the unmanaged file move function. diff --git a/core/modules/system/src/Tests/File/RemoteFileUnmanagedSaveDataTest.php b/core/modules/system/tests/src/Kernel/File/RemoteFileUnmanagedSaveDataTest.php similarity index 94% rename from core/modules/system/src/Tests/File/RemoteFileUnmanagedSaveDataTest.php rename to core/modules/system/tests/src/Kernel/File/RemoteFileUnmanagedSaveDataTest.php index 4c43330..8ad87ff 100644 --- a/core/modules/system/src/Tests/File/RemoteFileUnmanagedSaveDataTest.php +++ b/core/modules/system/tests/src/Kernel/File/RemoteFileUnmanagedSaveDataTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\system\Tests\File\RemoteFileUnmanagedSaveDataTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; /** * Tests the unmanaged file save data function. diff --git a/core/modules/system/src/Tests/File/ScanDirectoryTest.php b/core/modules/system/tests/src/Kernel/File/ScanDirectoryTest.php similarity index 99% rename from core/modules/system/src/Tests/File/ScanDirectoryTest.php rename to core/modules/system/tests/src/Kernel/File/ScanDirectoryTest.php index 4b067f0..3ac512e 100644 --- a/core/modules/system/src/Tests/File/ScanDirectoryTest.php +++ b/core/modules/system/tests/src/Kernel/File/ScanDirectoryTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\system\Tests\File\ScanDirectoryTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; /** * Tests the file_scan_directory() function. diff --git a/core/modules/system/src/Tests/File/StreamWrapperTest.php b/core/modules/system/tests/src/Kernel/File/StreamWrapperTest.php similarity index 97% rename from core/modules/system/src/Tests/File/StreamWrapperTest.php rename to core/modules/system/tests/src/Kernel/File/StreamWrapperTest.php index 5816861..16e4e25 100644 --- a/core/modules/system/src/Tests/File/StreamWrapperTest.php +++ b/core/modules/system/tests/src/Kernel/File/StreamWrapperTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\system\Tests\File\StreamWrapperTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; use Drupal\Core\DrupalKernel; use Drupal\Core\Site\Settings; @@ -41,14 +41,12 @@ class StreamWrapperTest extends FileTestBase { protected $classname = 'Drupal\file_test\StreamWrapper\DummyStreamWrapper'; function setUp() { + parent::setUp(); + // Add file_private_path setting. - $settings = Settings::getAll(); $request = Request::create('/');; $site_path = DrupalKernel::findSitePath($request); - $settings['file_private_path'] = $site_path . '/private'; - new Settings($settings + Settings::getAll()); - - parent::setUp(); + $this->setSetting('file_private_path', $site_path . '/private'); } /** diff --git a/core/modules/system/src/Tests/File/UnmanagedCopyTest.php b/core/modules/system/tests/src/Kernel/File/UnmanagedCopyTest.php similarity index 98% rename from core/modules/system/src/Tests/File/UnmanagedCopyTest.php rename to core/modules/system/tests/src/Kernel/File/UnmanagedCopyTest.php index 22a0615..ae36584 100644 --- a/core/modules/system/src/Tests/File/UnmanagedCopyTest.php +++ b/core/modules/system/tests/src/Kernel/File/UnmanagedCopyTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\system\Tests\File\UnmanagedCopyTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; use Drupal\Core\Site\Settings; use Drupal\Core\File\FileSystem; diff --git a/core/modules/system/src/Tests/File/UnmanagedDeleteRecursiveTest.php b/core/modules/system/tests/src/Kernel/File/UnmanagedDeleteRecursiveTest.php similarity index 98% rename from core/modules/system/src/Tests/File/UnmanagedDeleteRecursiveTest.php rename to core/modules/system/tests/src/Kernel/File/UnmanagedDeleteRecursiveTest.php index abef365..463df24 100644 --- a/core/modules/system/src/Tests/File/UnmanagedDeleteRecursiveTest.php +++ b/core/modules/system/tests/src/Kernel/File/UnmanagedDeleteRecursiveTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\system\Tests\File\UnmanagedDeleteRecursiveTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; /** * Tests the unmanaged file delete recursive function. diff --git a/core/modules/system/src/Tests/File/UnmanagedDeleteTest.php b/core/modules/system/tests/src/Kernel/File/UnmanagedDeleteTest.php similarity index 96% rename from core/modules/system/src/Tests/File/UnmanagedDeleteTest.php rename to core/modules/system/tests/src/Kernel/File/UnmanagedDeleteTest.php index 5cdcfe8..7784485 100644 --- a/core/modules/system/src/Tests/File/UnmanagedDeleteTest.php +++ b/core/modules/system/tests/src/Kernel/File/UnmanagedDeleteTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\system\Tests\File\UnmanagedDeleteTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; /** * Tests the unmanaged file delete function. diff --git a/core/modules/system/src/Tests/File/UnmanagedMoveTest.php b/core/modules/system/tests/src/Kernel/File/UnmanagedMoveTest.php similarity index 98% rename from core/modules/system/src/Tests/File/UnmanagedMoveTest.php rename to core/modules/system/tests/src/Kernel/File/UnmanagedMoveTest.php index 4a4e9e9..d3843a7 100644 --- a/core/modules/system/src/Tests/File/UnmanagedMoveTest.php +++ b/core/modules/system/tests/src/Kernel/File/UnmanagedMoveTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\system\Tests\File\UnmanagedMoveTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; use Drupal\Core\Site\Settings; use Drupal\Core\File\FileSystem; diff --git a/core/modules/system/src/Tests/File/UnmanagedSaveDataTest.php b/core/modules/system/tests/src/Kernel/File/UnmanagedSaveDataTest.php similarity index 92% rename from core/modules/system/src/Tests/File/UnmanagedSaveDataTest.php rename to core/modules/system/tests/src/Kernel/File/UnmanagedSaveDataTest.php index 2d3342c..9c460a3 100644 --- a/core/modules/system/src/Tests/File/UnmanagedSaveDataTest.php +++ b/core/modules/system/tests/src/Kernel/File/UnmanagedSaveDataTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\system\Tests\File\UnmanagedSaveDataTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; /** * Tests the file_unmanaged_save_data() function. @@ -18,7 +18,7 @@ class UnmanagedSaveDataTest extends FileTestBase { */ function testFileSaveData() { $contents = $this->randomMachineName(8); - $this->settingsSet('file_chmod_file', 0777); + $this->setSetting('file_chmod_file', 0777); // No filename. $filepath = file_unmanaged_save_data($contents); diff --git a/core/modules/system/src/Tests/File/UrlRewritingTest.php b/core/modules/system/tests/src/Kernel/File/UrlRewritingTest.php similarity index 99% rename from core/modules/system/src/Tests/File/UrlRewritingTest.php rename to core/modules/system/tests/src/Kernel/File/UrlRewritingTest.php index dd37222..2bd9eda 100644 --- a/core/modules/system/src/Tests/File/UrlRewritingTest.php +++ b/core/modules/system/tests/src/Kernel/File/UrlRewritingTest.php @@ -5,7 +5,7 @@ * Contains \Drupal\system\Tests\File\UrlRewritingTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\Tests\system\Kernel\File; use Symfony\Component\HttpFoundation\Request; diff --git a/core/modules/system/src/Tests/File/HtaccessUnitTest.php b/core/tests/Drupal/KernelTests/Core/File/HtaccessUnitTest.php similarity index 93% rename from core/modules/system/src/Tests/File/HtaccessUnitTest.php rename to core/tests/Drupal/KernelTests/Core/File/HtaccessUnitTest.php index 4b7f39d..490f967 100644 --- a/core/modules/system/src/Tests/File/HtaccessUnitTest.php +++ b/core/tests/Drupal/KernelTests/Core/File/HtaccessUnitTest.php @@ -5,10 +5,11 @@ * Contains \Drupal\system\Tests\File\HtaccessUnitTest. */ -namespace Drupal\system\Tests\File; +namespace Drupal\KernelTests\Core\File; use Drupal\Component\Utility\SafeMarkup; -use Drupal\simpletest\KernelTestBase; +use Drupal\Core\Site\Settings; +use Drupal\KernelTests\KernelTestBase; /** * Tests .htaccess file saving. @@ -22,8 +23,8 @@ class HtaccessUnitTest extends KernelTestBase { */ function testHtaccessSave() { // Prepare test directories. - $public = $this->publicFilesDirectory . '/test/public'; - $private = $this->publicFilesDirectory . '/test/private'; + $public = Settings::get('file_public_path') . '/test/public'; + $private = Settings::get('file_public_path') . '/test/private'; $stream = 'public://test/stream'; // Verify that file_save_htaccess() returns FALSE if .htaccess cannot be