diff --git a/core/modules/file/src/Tests/Views/RelationshipUserFileDataTest.php b/core/modules/file/src/Tests/Views/RelationshipUserFileDataTest.php index db49ae1..6115e1a 100644 --- a/core/modules/file/src/Tests/Views/RelationshipUserFileDataTest.php +++ b/core/modules/file/src/Tests/Views/RelationshipUserFileDataTest.php @@ -67,7 +67,7 @@ public function testViewsHandlerRelationshipUserFileData() { 'status' => FILE_STATUS_PERMANENT, ]); $file->enforceIsNew(); - file_put_contents($file->getFileUri(), file_get_contents('core/modules/simpletest/files/image-1.png')); + file_put_contents($file->getFileUri(), file_get_contents('core/tests/fixtures/files/image-1.png')); $file->save(); $account = $this->drupalCreateUser(); diff --git a/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileTest.php b/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileTest.php index 7e1cff9..65316d0 100644 --- a/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileTest.php +++ b/core/modules/file/tests/src/Kernel/Migrate/d6/MigrateFileTest.php @@ -91,7 +91,7 @@ public function testFiles() { $this->executeMigration('d6_file'); $file = File::load(2); - $this->assertIdentical('public://core/modules/simpletest/files/image-2.jpg', $file->getFileUri()); + $this->assertIdentical('public://core/tests/fixtures/files/image-2.jpg', $file->getFileUri()); // File 7, created in static::migrateDumpAlter(), shares a path with // file 5, which means it should be skipped entirely. diff --git a/core/modules/image/src/Tests/Views/RelationshipUserImageDataTest.php b/core/modules/image/src/Tests/Views/RelationshipUserImageDataTest.php index f9381d4..979388c 100644 --- a/core/modules/image/src/Tests/Views/RelationshipUserImageDataTest.php +++ b/core/modules/image/src/Tests/Views/RelationshipUserImageDataTest.php @@ -67,7 +67,7 @@ public function testViewsHandlerRelationshipUserImageData() { 'status' => FILE_STATUS_PERMANENT, ]); $file->enforceIsNew(); - file_put_contents($file->getFileUri(), file_get_contents('core/modules/simpletest/files/image-1.png')); + file_put_contents($file->getFileUri(), file_get_contents('core/tests/fixtures/files/image-1.png')); $file->save(); $account = $this->drupalCreateUser(); diff --git a/core/modules/migrate/tests/src/Kernel/process/CopyFileTest.php b/core/modules/migrate/tests/src/Kernel/process/CopyFileTest.php index 288ebfb..425b625 100644 --- a/core/modules/migrate/tests/src/Kernel/process/CopyFileTest.php +++ b/core/modules/migrate/tests/src/Kernel/process/CopyFileTest.php @@ -45,7 +45,7 @@ public function testSuccessfulCopies() { $data_sets = [ // Test a local to local copy. [ - $this->root . '/core/modules/simpletest/files/image-test.jpg', + $this->root . '/core/tests/fixtures/files/image-test.jpg', 'public://file1.jpg' ], // Test a temporary file using an absolute path. @@ -56,7 +56,7 @@ public function testSuccessfulCopies() { // Test a temporary file using a relative path. [ $file_absolute, - 'temporary://core/modules/simpletest/files/test.jpg' + 'temporary://core/tests/fixtures/files/test.jpg' ], ]; foreach ($data_sets as $data) { @@ -93,7 +93,7 @@ public function testSuccessfulMoves() { // Test a temporary file using a relative path. [ $file_2_absolute, - 'temporary://core/modules/simpletest/files/test.jpg' + 'temporary://core/tests/fixtures/files/test.jpg' ], ]; foreach ($data_sets as $data) { diff --git a/core/modules/migrate_drupal/tests/fixtures/drupal6.php b/core/modules/migrate_drupal/tests/fixtures/drupal6.php index 347b2f2..2067345 100644 --- a/core/modules/migrate_drupal/tests/fixtures/drupal6.php +++ b/core/modules/migrate_drupal/tests/fixtures/drupal6.php @@ -7715,7 +7715,7 @@ 'fid' => '1', 'uid' => '1', 'filename' => 'Image1.png', - 'filepath' => 'core/modules/simpletest/files/image-1.png', + 'filepath' => 'core/tests/fixtures/files/image-1.png', 'filemime' => 'image/png', 'filesize' => '39325', 'status' => '1', @@ -7725,7 +7725,7 @@ 'fid' => '2', 'uid' => '1', 'filename' => 'Image2.jpg', - 'filepath' => 'core/modules/simpletest/files/image-2.jpg', + 'filepath' => 'core/tests/fixtures/files/image-2.jpg', 'filemime' => 'image/jpeg', 'filesize' => '1831', 'status' => '1', @@ -7735,7 +7735,7 @@ 'fid' => '3', 'uid' => '1', 'filename' => 'Image-test.gif', - 'filepath' => 'core/modules/simpletest/files/image-test.gif', + 'filepath' => 'core/tests/fixtures/files/image-test.gif', 'filemime' => 'image/jpeg', 'filesize' => '183', 'status' => '1', @@ -7745,7 +7745,7 @@ 'fid' => '5', 'uid' => '1', 'filename' => 'html-1.txt', - 'filepath' => 'core/modules/simpletest/files/html-1.txt', + 'filepath' => 'core/tests/fixtures/files/html-1.txt', 'filemime' => 'text/plain', 'filesize' => '24', 'status' => '1', @@ -31837,8 +31837,8 @@ 'menu_name' => 'navigation', 'mlid' => '411', 'plid' => '0', - 'link_path' => 'core/modules/simpletest/files/imagecache', - 'router_path' => 'core/modules/simpletest/files/imagecache', + 'link_path' => 'core/tests/fixtures/files/imagecache', + 'router_path' => 'core/tests/fixtures/files/imagecache', 'link_title' => '', 'options' => 'a:0:{}', 'module' => 'system', @@ -39729,7 +39729,7 @@ 'file' => 'sites/all/modules/cck/includes/content.node_form.inc', )) ->values(array( - 'path' => 'core/modules/simpletest/files/imagecache', + 'path' => 'core/tests/fixtures/files/imagecache', 'load_functions' => '', 'to_arg_functions' => '', 'access_callback' => '_imagecache_menu_access_public_files', @@ -39739,7 +39739,7 @@ 'fit' => '31', 'number_parts' => '5', 'tab_parent' => '', - 'tab_root' => 'core/modules/simpletest/files/imagecache', + 'tab_root' => 'core/tests/fixtures/files/imagecache', 'title' => '', 'title_callback' => 't', 'title_arguments' => '', @@ -44575,7 +44575,7 @@ 'status' => '1', 'timezone' => '3600', 'language' => 'fr', - 'picture' => 'core/modules/simpletest/files/image-test.jpg', + 'picture' => 'core/tests/fixtures/files/image-test.jpg', 'init' => 'doe@example.com', 'data' => 'a:2:{s:7:"contact";i:1;s:13:"form_build_id";s:48:"form-qu_DMjE-Vfg01arT5J4VbuBCkOgx_LeySJx4qrPOSuA";}', 'timezone_name' => 'Europe/Berlin', @@ -44600,7 +44600,7 @@ 'status' => '1', 'timezone' => '7200', 'language' => 'ro', - 'picture' => 'core/modules/simpletest/files/image-test.png', + 'picture' => 'core/tests/fixtures/files/image-test.png', 'init' => 'roe@example.com', 'data' => 'a:2:{s:7:"contact";i:0;s:13:"form_build_id";s:48:"form-1TxjbL2_1dEHIxEu2Db6OvEsSN1x9ILH1VCgnvsO6LE";}', 'timezone_name' => 'Europe/Helsinki', @@ -45539,7 +45539,7 @@ )) ->values(array( 'name' => 'file_directory_path', - 'value' => 's:29:"core/modules/simpletest/files";', + 'value' => 's:25:"core/tests/fixtures/files";', )) ->values(array( 'name' => 'file_directory_temp', diff --git a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserTest.php b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserTest.php index 9317834..5a677ad 100644 --- a/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserTest.php +++ b/core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserTest.php @@ -43,7 +43,7 @@ protected function setUp() { 'status' => FILE_STATUS_PERMANENT, )); $file->enforceIsNew(); - file_put_contents($file->getFileUri(), file_get_contents('core/modules/simpletest/files/image-1.png')); + file_put_contents($file->getFileUri(), file_get_contents('core/tests/fixtures/files/image-1.png')); $file->save(); $file = File::create(array( @@ -57,7 +57,7 @@ protected function setUp() { 'status' => FILE_STATUS_PERMANENT, )); $file->enforceIsNew(); - file_put_contents($file->getFileUri(), file_get_contents('core/modules/simpletest/files/image-2.jpg')); + file_put_contents($file->getFileUri(), file_get_contents('core/tests/fixtures/files/image-2.jpg')); $file->save(); $this->migrateUsers(); diff --git a/core/modules/user/tests/src/Unit/Migrate/d6/UserPictureFileTest.php b/core/modules/user/tests/src/Unit/Migrate/d6/UserPictureFileTest.php index 6c045ea..e274968 100644 --- a/core/modules/user/tests/src/Unit/Migrate/d6/UserPictureFileTest.php +++ b/core/modules/user/tests/src/Unit/Migrate/d6/UserPictureFileTest.php @@ -24,7 +24,7 @@ class UserPictureFileTest extends MigrateSqlSourceTestCase { protected $expectedResults = array( array( 'uid' => '2', - 'picture' => 'core/modules/simpletest/files/image-test.jpg', + 'picture' => 'core/tests/fixtures/files/image-test.jpg', ), ); @@ -35,7 +35,7 @@ protected function setUp() { $this->databaseContents['users'] = array( array( 'uid' => '2', - 'picture' => 'core/modules/simpletest/files/image-test.jpg', + 'picture' => 'core/tests/fixtures/files/image-test.jpg', ), array( 'uid' => '15', diff --git a/core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php b/core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php index 8362c04..ebd3b56 100644 --- a/core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php +++ b/core/tests/Drupal/KernelTests/Core/File/ScanDirectoryTest.php @@ -23,11 +23,7 @@ class ScanDirectoryTest extends FileTestBase { protected function setUp() { parent::setUp(); - // Hardcode the location of the simpletest files as it is already known - // and shouldn't change, and we don't yet have a way to retrieve their - // location from drupal_get_filename() in a cached way. - // @todo Remove as part of https://www.drupal.org/node/2186491 - $this->path = 'core/modules/simpletest/files'; + $this->path = 'core/tests/fixtures/files'; } /** diff --git a/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php b/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php index fe36c3d..ba3c0b2 100644 --- a/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php +++ b/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php @@ -42,7 +42,7 @@ class ToolkitGdTest extends KernelTestBase { * * @var array */ - public static $modules = array('system', 'simpletest'); + public static $modules = ['system']; /** * {@inheritdoc} @@ -275,7 +275,7 @@ function testManipulations() { foreach ($files as $file) { foreach ($operations as $op => $values) { // Load up a fresh image. - $image = $this->imageFactory->get(drupal_get_path('module', 'simpletest') . '/files/' . $file); + $image = $this->imageFactory->get("core/tests/fixtures/files/$file"); $toolkit = $image->getToolkit(); if (!$image->isValid()) { $this->fail(SafeMarkup::format('Could not load image %file.', array('%file' => $file))); @@ -421,14 +421,14 @@ function testManipulations() { */ public function testResourceDestruction() { // Test that an Image object going out of scope releases its GD resource. - $image = $this->imageFactory->get(drupal_get_path('module', 'simpletest') . '/files/image-test.png'); + $image = $this->imageFactory->get('core/tests/fixtures/files/image-test.png'); $res = $image->getToolkit()->getResource(); $this->assertTrue(is_resource($res), 'Successfully loaded image resource.'); $image = NULL; $this->assertFalse(is_resource($res), 'Image resource was destroyed after losing scope.'); // Test that 'create_new' operation does not leave orphaned GD resources. - $image = $this->imageFactory->get(drupal_get_path('module', 'simpletest') . '/files/image-test.png'); + $image = $this->imageFactory->get('core/tests/fixtures/files/image-test.png'); $old_res = $image->getToolkit()->getResource(); // Check if resource has been created successfully. $this->assertTrue(is_resource($old_res)); @@ -451,7 +451,7 @@ function testGifTransparentImages() { // Test loading an indexed GIF image with transparent color set. // Color at top-right pixel should be fully transparent. $file = 'image-test-transparent-indexed.gif'; - $image = $this->imageFactory->get(drupal_get_path('module', 'simpletest') . '/files/' . $file); + $image = $this->imageFactory->get("core/tests/fixtures/files/$file"); $resource = $image->getToolkit()->getResource(); $color_index = imagecolorat($resource, $image->getWidth() - 1, 0); $color = array_values(imagecolorsforindex($resource, $color_index)); @@ -485,14 +485,14 @@ function testGifTransparentImages() { // of 6 colors, and setting the transparent color index to 6 (one higher // than the largest allowed index), as follows: // @code - // $image = imagecreatefromgif('core/modules/simpletest/files/image-test.gif'); + // $image = imagecreatefromgif('core/tests/fixtures/files/image-test.gif'); // imagecolortransparent($image, 6); - // imagegif($image, 'core/modules/simpletest/files/image-test-transparent-out-of-range.gif'); + // imagegif($image, 'core/tests/fixtures/files/image-test-transparent-out-of-range.gif'); // @endcode // This allows us to test that an image with an out-of-range color index // can be loaded correctly. $file = 'image-test-transparent-out-of-range.gif'; - $image = $this->imageFactory->get(drupal_get_path('module', 'simpletest') . '/files/' . $file); + $image = $this->imageFactory->get("core/tests/fixtures/files/$file"); $toolkit = $image->getToolkit(); if (!$image->isValid()) { @@ -517,7 +517,7 @@ function testMissingOperation() { $file = 'image-test.png'; // Load up a fresh image. - $image = $this->imageFactory->get(drupal_get_path('module', 'simpletest') . '/files/' . $file); + $image = $this->imageFactory->get("core/tests/fixtures/files/$file"); if (!$image->isValid()) { $this->fail(SafeMarkup::format('Could not load image %file.', array('%file' => $file))); } diff --git a/core/tests/Drupal/KernelTests/Core/Installer/InstallerLanguageTest.php b/core/tests/Drupal/KernelTests/Core/Installer/InstallerLanguageTest.php index 060ee46..f552774 100644 --- a/core/tests/Drupal/KernelTests/Core/Installer/InstallerLanguageTest.php +++ b/core/tests/Drupal/KernelTests/Core/Installer/InstallerLanguageTest.php @@ -27,7 +27,7 @@ function testInstallerTranslationFiles() { // Hardcode the simpletest module location as we don't yet know where it is. // @todo Remove as part of https://www.drupal.org/node/2186491 - $file_translation = new FileTranslation('core/modules/simpletest/files/translations'); + $file_translation = new FileTranslation('core/tests/fixtures/files/translations'); foreach ($expected_translation_files as $langcode => $files_expected) { $files_found = $file_translation->findTranslationFiles($langcode); $this->assertTrue(count($files_found) == count($files_expected), format_string('@count installer languages found.', array('@count' => count($files_expected)))); diff --git a/core/tests/Drupal/Tests/TestFileCreationTrait.php b/core/tests/Drupal/Tests/TestFileCreationTrait.php index 33d36fb..b9b253c 100644 --- a/core/tests/Drupal/Tests/TestFileCreationTrait.php +++ b/core/tests/Drupal/Tests/TestFileCreationTrait.php @@ -68,7 +68,7 @@ protected function getTestFiles($type, $size = NULL) { } // Copy other test files. - $original = \Drupal::root() . '/core/tests/fixtures/files'; + $original = 'core/tests/fixtures/files'; $files = file_scan_directory($original, '/(html|image|javascript|php|sql)-.*/'); foreach ($files as $file) { file_unmanaged_copy($file->uri, PublicStream::basePath());