diff --git a/core/modules/config/src/Tests/ConfigCRUDTest.php b/core/modules/config/src/Tests/ConfigCRUDTest.php index 435a922..3d61c9e 100644 --- a/core/modules/config/src/Tests/ConfigCRUDTest.php +++ b/core/modules/config/src/Tests/ConfigCRUDTest.php @@ -248,7 +248,7 @@ public function testDataTypes() { $storage = new DatabaseStorage($this->container->get('database'), 'config'); $name = 'config_test.types'; $config = $this->config($name); - $original_content = file_get_contents(__DIR__ . '/../../tests/config_test/' . InstallStorage::CONFIG_INSTALL_DIRECTORY . "/$name.yml"); + $original_content = file_get_contents(drupal_get_path('module', 'config_test') . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY . "/$name.yml"); $this->verbose('
' . $original_content . "\n" . var_export($storage->read($name), TRUE)); // Verify variable data types are intact. diff --git a/core/modules/field/src/Tests/FieldImportCreateTest.php b/core/modules/field/src/Tests/FieldImportCreateTest.php index 4036446..82cb962 100644 --- a/core/modules/field/src/Tests/FieldImportCreateTest.php +++ b/core/modules/field/src/Tests/FieldImportCreateTest.php @@ -97,7 +97,7 @@ function testImportCreate() { $this->copyConfig($active, $sync); // Add the new files to the sync directory. - $src_dir = __DIR__ . '/../../tests/modules/field_test_config/sync'; + $src_dir = drupal_get_path('module', 'field_test_config') . '/sync'; $target_dir = $this->configDirectories[CONFIG_SYNC_DIRECTORY]; $this->assertTrue(file_unmanaged_copy("$src_dir/$field_storage_config_name.yml", "$target_dir/$field_storage_config_name.yml")); $this->assertTrue(file_unmanaged_copy("$src_dir/$field_config_name.yml", "$target_dir/$field_config_name.yml")); diff --git a/core/modules/node/src/Tests/Config/NodeImportCreateTest.php b/core/modules/node/src/Tests/Config/NodeImportCreateTest.php index 4784d1a..fc87cf3 100644 --- a/core/modules/node/src/Tests/Config/NodeImportCreateTest.php +++ b/core/modules/node/src/Tests/Config/NodeImportCreateTest.php @@ -64,7 +64,7 @@ public function testImportCreate() { $sync = $this->container->get('config.storage.sync'); $this->copyConfig($active, $sync); // Manually add new node type. - $src_dir = __DIR__ . '/../../../tests/modules/node_test_config/sync'; + $src_dir = drupal_get_path('module', 'node_test_config') . '/sync'; $target_dir = $this->configDirectories[CONFIG_SYNC_DIRECTORY]; $this->assertTrue(file_unmanaged_copy("$src_dir/$node_type_config_name.yml", "$target_dir/$node_type_config_name.yml")); diff --git a/core/modules/system/src/Tests/Theme/ThemeTest.php b/core/modules/system/src/Tests/Theme/ThemeTest.php index 4af1add..a84ef8f 100644 --- a/core/modules/system/src/Tests/Theme/ThemeTest.php +++ b/core/modules/system/src/Tests/Theme/ThemeTest.php @@ -265,7 +265,7 @@ function testClassLoading() { */ public function testFindThemeTemplates() { $registry = $this->container->get('theme.registry')->get(); - $templates = drupal_find_theme_templates($registry, '.html.twig', __DIR__ . '/../../../tests/themes/test_theme'); + $templates = drupal_find_theme_templates($registry, '.html.twig', drupal_get_path('theme', 'test_theme')); $this->assertEqual($templates['node__1']['template'], 'node--1', 'Template node--1.tpl.twig was found in test_theme.'); }