Skip to content

Commit

Permalink
Restrict assertions for SymfonyCmfRouteObjectInterfaceConstantsRuleTest
Browse files Browse the repository at this point in the history
  • Loading branch information
mglaman committed Jul 13, 2022
1 parent ecff639 commit 78d8fa5
Showing 1 changed file with 31 additions and 24 deletions.
55 changes: 31 additions & 24 deletions tests/src/Rules/SymfonyCmfRouteObjectInterfaceConstantsRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
],
]
);
}
}

}

0 comments on commit 78d8fa5

Please sign in to comment.