Skip to content

Commit 78d8fa5

Browse files
committed
Restrict assertions for SymfonyCmfRouteObjectInterfaceConstantsRuleTest
1 parent ecff639 commit 78d8fa5

File tree

1 file changed

+31
-24
lines changed

1 file changed

+31
-24
lines changed

tests/src/Rules/SymfonyCmfRouteObjectInterfaceConstantsRuleTest.php

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,38 @@ protected function getRule(): \PHPStan\Rules\Rule
1616

1717
public function testRule(): void
1818
{
19-
$this->analyse(
20-
[__DIR__.'/data/symfony-cmf-routing.php'],
21-
[
19+
[$version] = explode('.', \Drupal::VERSION, 2);
20+
if ($version === '8') {
21+
$this->analyse([__DIR__.'/data/symfony-cmf-routing.php'], []);
22+
} elseif ($version === '10') {
23+
self::markTestSkipped('Not tested on 10.x.x');
24+
} else {
25+
$this->analyse(
26+
[__DIR__.'/data/symfony-cmf-routing.php'],
2227
[
23-
'Symfony\Cmf\Component\Routing\RouteObjectInterface::ROUTE_NAME is deprecated and removed in Drupal 10. Use \Drupal\Core\Routing\RouteObjectInterface::ROUTE_NAME instead.',
24-
6,
25-
'Change record: https://www.drupal.org/node/3151009'
26-
],
27-
[
28-
'Symfony\Cmf\Component\Routing\RouteObjectInterface::ROUTE_OBJECT is deprecated and removed in Drupal 10. Use \Drupal\Core\Routing\RouteObjectInterface::ROUTE_OBJECT instead.',
29-
7,
30-
'Change record: https://www.drupal.org/node/3151009'
31-
],
32-
[
33-
'Symfony\Cmf\Component\Routing\RouteObjectInterface::CONTROLLER_NAME is deprecated and removed in Drupal 10. Use \Drupal\Core\Routing\RouteObjectInterface::CONTROLLER_NAME instead.',
34-
8,
35-
'Change record: https://www.drupal.org/node/3151009'
36-
],
37-
[
38-
'The core dependency symfony-cmf/routing is deprecated and Symfony\Cmf\Component\Routing\RouteObjectInterface::TEMPLATE_NAME is not supported.',
39-
9,
40-
'Change record: https://www.drupal.org/node/3151009'
41-
],
42-
]
43-
);
28+
[
29+
'Symfony\Cmf\Component\Routing\RouteObjectInterface::ROUTE_NAME is deprecated and removed in Drupal 10. Use \Drupal\Core\Routing\RouteObjectInterface::ROUTE_NAME instead.',
30+
6,
31+
'Change record: https://www.drupal.org/node/3151009'
32+
],
33+
[
34+
'Symfony\Cmf\Component\Routing\RouteObjectInterface::ROUTE_OBJECT is deprecated and removed in Drupal 10. Use \Drupal\Core\Routing\RouteObjectInterface::ROUTE_OBJECT instead.',
35+
7,
36+
'Change record: https://www.drupal.org/node/3151009'
37+
],
38+
[
39+
'Symfony\Cmf\Component\Routing\RouteObjectInterface::CONTROLLER_NAME is deprecated and removed in Drupal 10. Use \Drupal\Core\Routing\RouteObjectInterface::CONTROLLER_NAME instead.',
40+
8,
41+
'Change record: https://www.drupal.org/node/3151009'
42+
],
43+
[
44+
'The core dependency symfony-cmf/routing is deprecated and Symfony\Cmf\Component\Routing\RouteObjectInterface::TEMPLATE_NAME is not supported.',
45+
9,
46+
'Change record: https://www.drupal.org/node/3151009'
47+
],
48+
]
49+
);
50+
}
4451
}
4552

4653
}

0 commit comments

Comments
 (0)