diff --git a/core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDateonlyTest.php b/core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDateonlyTest.php index 1051ce4..0fb404d 100644 --- a/core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDateonlyTest.php +++ b/core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDateonlyTest.php @@ -7,8 +7,8 @@ use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem; use Drupal\field\Entity\FieldConfig; use Drupal\field\Entity\FieldStorageConfig; +use Drupal\Tests\entity_test\Functional\Rest\EntityTestResourceTestBase; use Drupal\Tests\rest\Functional\AnonResourceTestTrait; -use Drupal\Tests\rest\Functional\EntityResource\EntityTest\EntityTestResourceTestBase; use GuzzleHttp\RequestOptions; /** diff --git a/core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDatetimeTest.php b/core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDatetimeTest.php index ffce48c..cdd4d60 100644 --- a/core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDatetimeTest.php +++ b/core/modules/datetime/tests/src/Functional/EntityResource/EntityTest/EntityTestDatetimeTest.php @@ -7,8 +7,8 @@ use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem; use Drupal\field\Entity\FieldConfig; use Drupal\field\Entity\FieldStorageConfig; +use Drupal\Tests\entity_test\Functional\Rest\EntityTestResourceTestBase; use Drupal\Tests\rest\Functional\AnonResourceTestTrait; -use Drupal\Tests\rest\Functional\EntityResource\EntityTest\EntityTestResourceTestBase; use GuzzleHttp\RequestOptions; /** diff --git a/core/modules/hal/tests/src/Functional/EntityResource/Action/ActionHalJsonAnonTest.php b/core/modules/hal/tests/src/Functional/EntityResource/Action/ActionHalJsonAnonTest.php index 0eae866..eb19bac 100644 --- a/core/modules/hal/tests/src/Functional/EntityResource/Action/ActionHalJsonAnonTest.php +++ b/core/modules/hal/tests/src/Functional/EntityResource/Action/ActionHalJsonAnonTest.php @@ -1,9 +1,9 @@ [ - 'possible paths' => [ - '\Drupal\Tests\rest\Functional\EntityResource\CLASS\CLASS', - ], + 'path' => '\Drupal\Tests\PROVIDER\Functional\Rest\CLASS', 'class suffix' => [ 'JsonAnonTest', 'JsonBasicAuthTest', @@ -74,9 +72,7 @@ public function testEntityTypeRestTestCoverage() { ], // Test coverage for formats provided by the 'hal' module. 'hal' => [ - 'possible paths' => [ - '\Drupal\Tests\hal\Functional\EntityResource\CLASS\CLASS', - ], + 'path' => '\Drupal\Tests\PROVIDER\Functional\Hal\CLASS', 'class suffix' => [ 'HalJsonAnonTest', 'HalJsonBasicAuthTest', @@ -92,21 +88,13 @@ public function testEntityTypeRestTestCoverage() { $class_name = end($parts); $module_name = $parts[1]; - // The test class can live either in the REST/HAL module, or in the module - // providing the entity type. - $tests = $default_test_locations; - $tests['serialization']['possible paths'][] = '\Drupal\Tests\\' . $module_name . '\Functional\Rest\CLASS'; - $tests['hal']['possible paths'][] = '\Drupal\Tests\\' . $module_name . '\Functional\Hal\CLASS'; - foreach ($tests as $module => $info) { - $possible_paths = $info['possible paths']; + $path = $info['path']; $missing_tests = []; foreach ($info['class suffix'] as $postfix) { - foreach ($possible_paths as $path) { - $class = str_replace('CLASS', $class_name, $path . $postfix); - if (class_exists($class)) { - continue 2; - } + $class = str_replace(['PROVIDER', 'CLASS'], [$module_name, $class_name], $path . $postfix); + if (class_exists($class)) { + continue; } $missing_tests[] = $postfix; } diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityTest/EntityTestJsonAnonTest.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityTest/EntityTestJsonAnonTest.php index 1deeec0..58d15b3 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/EntityTest/EntityTestJsonAnonTest.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityTest/EntityTestJsonAnonTest.php @@ -1,6 +1,6 @@