.../tests/src/Functional/EntityResource/EntityResourceTestBase.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php index d1a5ac0..2542912 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php @@ -19,6 +19,7 @@ use Drupal\path\Plugin\Field\FieldType\PathItem; use Drupal\rest\ResourceResponseInterface; use Drupal\Tests\rest\Functional\ResourceTestBase; +use Drupal\Tests\Traits\ExpectDeprecationTrait; use GuzzleHttp\RequestOptions; use Psr\Http\Message\ResponseInterface; use Symfony\Component\Routing\Exception\RouteNotFoundException; @@ -73,6 +74,8 @@ */ abstract class EntityResourceTestBase extends ResourceTestBase { + use ExpectDeprecationTrait; + /** * The tested entity type. * @@ -708,6 +711,7 @@ public function testGet() { // new and old sites, but trigger deprecation notices. $bc_route = Url::fromRoute('rest.entity.' . static::$entityTypeId . '.GET.' . static::$format, $url->getRouteParameters(), $url->getOptions()); $bc_route->setUrlGenerator($this->container->get('url_generator')); + $this->expectDeprecation(sprintf("The 'rest.entity.%s.GET.%s' route is deprecated since version 8.5.x and will be removed in 9.0.0. Use the 'rest.entity.%s.%s' route instead.", static::$entityTypeId, static::$format, static::$entityTypeId, static::$format)); $this->assertSame($url->toString(TRUE)->getGeneratedUrl(), $bc_route->toString(TRUE)->getGeneratedUrl()); // Verify no format-specific GET BC routes are created for other formats. $other_format = static::$format === 'json' ? 'xml' : 'json';