From 78d8fa5de5746a244651a8a797b91617e2083510 Mon Sep 17 00:00:00 2001 From: Matt Glaman Date: Wed, 13 Jul 2022 10:08:10 -0500 Subject: [PATCH] Restrict assertions for SymfonyCmfRouteObjectInterfaceConstantsRuleTest --- ...fRouteObjectInterfaceConstantsRuleTest.php | 55 +++++++++++-------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/tests/src/Rules/SymfonyCmfRouteObjectInterfaceConstantsRuleTest.php b/tests/src/Rules/SymfonyCmfRouteObjectInterfaceConstantsRuleTest.php index f486c6cc..bc40c0cc 100644 --- a/tests/src/Rules/SymfonyCmfRouteObjectInterfaceConstantsRuleTest.php +++ b/tests/src/Rules/SymfonyCmfRouteObjectInterfaceConstantsRuleTest.php @@ -16,31 +16,38 @@ protected function getRule(): \PHPStan\Rules\Rule public function testRule(): void { - $this->analyse( - [__DIR__.'/data/symfony-cmf-routing.php'], - [ + [$version] = explode('.', \Drupal::VERSION, 2); + if ($version === '8') { + $this->analyse([__DIR__.'/data/symfony-cmf-routing.php'], []); + } elseif ($version === '10') { + self::markTestSkipped('Not tested on 10.x.x'); + } else { + $this->analyse( + [__DIR__.'/data/symfony-cmf-routing.php'], [ - 'Symfony\Cmf\Component\Routing\RouteObjectInterface::ROUTE_NAME is deprecated and removed in Drupal 10. Use \Drupal\Core\Routing\RouteObjectInterface::ROUTE_NAME instead.', - 6, - 'Change record: https://www.drupal.org/node/3151009' - ], - [ - 'Symfony\Cmf\Component\Routing\RouteObjectInterface::ROUTE_OBJECT is deprecated and removed in Drupal 10. Use \Drupal\Core\Routing\RouteObjectInterface::ROUTE_OBJECT instead.', - 7, - 'Change record: https://www.drupal.org/node/3151009' - ], - [ - 'Symfony\Cmf\Component\Routing\RouteObjectInterface::CONTROLLER_NAME is deprecated and removed in Drupal 10. Use \Drupal\Core\Routing\RouteObjectInterface::CONTROLLER_NAME instead.', - 8, - 'Change record: https://www.drupal.org/node/3151009' - ], - [ - 'The core dependency symfony-cmf/routing is deprecated and Symfony\Cmf\Component\Routing\RouteObjectInterface::TEMPLATE_NAME is not supported.', - 9, - 'Change record: https://www.drupal.org/node/3151009' - ], - ] - ); + [ + 'Symfony\Cmf\Component\Routing\RouteObjectInterface::ROUTE_NAME is deprecated and removed in Drupal 10. Use \Drupal\Core\Routing\RouteObjectInterface::ROUTE_NAME instead.', + 6, + 'Change record: https://www.drupal.org/node/3151009' + ], + [ + 'Symfony\Cmf\Component\Routing\RouteObjectInterface::ROUTE_OBJECT is deprecated and removed in Drupal 10. Use \Drupal\Core\Routing\RouteObjectInterface::ROUTE_OBJECT instead.', + 7, + 'Change record: https://www.drupal.org/node/3151009' + ], + [ + 'Symfony\Cmf\Component\Routing\RouteObjectInterface::CONTROLLER_NAME is deprecated and removed in Drupal 10. Use \Drupal\Core\Routing\RouteObjectInterface::CONTROLLER_NAME instead.', + 8, + 'Change record: https://www.drupal.org/node/3151009' + ], + [ + 'The core dependency symfony-cmf/routing is deprecated and Symfony\Cmf\Component\Routing\RouteObjectInterface::TEMPLATE_NAME is not supported.', + 9, + 'Change record: https://www.drupal.org/node/3151009' + ], + ] + ); + } } }