diff --git a/.travis.yml b/.travis.yml index 80a64c3f..338a52a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,6 +40,8 @@ matrix: env: SYMFONY_REQUIRE=4.4.* - php: 7.4 env: SYMFONY_REQUIRE=5.0.* + - php: nightly + env: COMPOSER_FLAGS="--no-interaction --ignore-platform-reqs" SYMFONY_PHPUNIT_VERSION=9 SYMFONY_REQUIRE=5.0.* fast_finish: true allow_failures: diff --git a/composer.json b/composer.json index 2e37d7c1..6e57d304 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": "^7.2", + "php": "^7.2 || ^8.0", "symfony/routing": "^4.4 || ^5.0", "symfony/http-kernel": "^4.4 || ^5.0", "psr/log": "^1.0" diff --git a/tests/Unit/Enhancer/ContentRepositoryEnhancerTest.php b/tests/Unit/Enhancer/ContentRepositoryEnhancerTest.php index fd05e4c8..01674ebe 100644 --- a/tests/Unit/Enhancer/ContentRepositoryEnhancerTest.php +++ b/tests/Unit/Enhancer/ContentRepositoryEnhancerTest.php @@ -22,7 +22,7 @@ class ContentRepositoryEnhancerTest extends TestCase /** * {@inheritdoc} */ - public function setUp() + public function setUp(): void { $cRepository = $this->createMock(ContentRepositoryInterface::class); $cRepository diff --git a/tests/Unit/Enhancer/FieldByClassEnhancerTest.php b/tests/Unit/Enhancer/FieldByClassEnhancerTest.php index 7427bdf2..43feeeaa 100644 --- a/tests/Unit/Enhancer/FieldByClassEnhancerTest.php +++ b/tests/Unit/Enhancer/FieldByClassEnhancerTest.php @@ -26,7 +26,7 @@ class FieldByClassEnhancerTest extends TestCase private $document; - public function setUp() + public function setUp(): void { $this->document = $this->createMock(RouteObject::class); diff --git a/tests/Unit/Enhancer/FieldMapEnhancerTest.php b/tests/Unit/Enhancer/FieldMapEnhancerTest.php index cac4f2a3..1f9fc45c 100644 --- a/tests/Unit/Enhancer/FieldMapEnhancerTest.php +++ b/tests/Unit/Enhancer/FieldMapEnhancerTest.php @@ -27,7 +27,7 @@ class FieldMapEnhancerTest extends TestCase */ private $enhancer; - public function setUp() + public function setUp(): void { $this->request = Request::create('/test'); $mapping = ['static_pages' => 'cmf_content.controller:indexAction']; diff --git a/tests/Unit/Enhancer/FieldPresenceEnhancerTest.php b/tests/Unit/Enhancer/FieldPresenceEnhancerTest.php index dd8118ad..410a5cc8 100644 --- a/tests/Unit/Enhancer/FieldPresenceEnhancerTest.php +++ b/tests/Unit/Enhancer/FieldPresenceEnhancerTest.php @@ -24,7 +24,7 @@ class FieldPresenceEnhancerTest extends TestCase private $request; - public function setUp() + public function setUp(): void { $this->mapper = new FieldPresenceEnhancer('_template', '_controller', 'cmf_content.controller:indexAction'); diff --git a/tests/Unit/Enhancer/RouteContentEnhancerTest.php b/tests/Unit/Enhancer/RouteContentEnhancerTest.php index 15ccb4d5..7467d7e6 100644 --- a/tests/Unit/Enhancer/RouteContentEnhancerTest.php +++ b/tests/Unit/Enhancer/RouteContentEnhancerTest.php @@ -28,7 +28,7 @@ class RouteContentEnhancerTest extends TestCase private $request; - public function setUp() + public function setUp(): void { $this->document = $this->createMock(RouteObject::class); diff --git a/tests/Unit/NestedMatcher/NestedMatcherTest.php b/tests/Unit/NestedMatcher/NestedMatcherTest.php index c88df399..120f1b96 100644 --- a/tests/Unit/NestedMatcher/NestedMatcherTest.php +++ b/tests/Unit/NestedMatcher/NestedMatcherTest.php @@ -31,7 +31,7 @@ class NestedMatcherTest extends TestCase private $finalMatcher; - public function setUp() + public function setUp(): void { $this->provider = $this->createMock(RouteProviderInterface::class); $this->routeFilter1 = $this->createMock(RouteFilterInterface::class); diff --git a/tests/Unit/NestedMatcher/UrlMatcherTest.php b/tests/Unit/NestedMatcher/UrlMatcherTest.php index 725b8955..776470e9 100644 --- a/tests/Unit/NestedMatcher/UrlMatcherTest.php +++ b/tests/Unit/NestedMatcher/UrlMatcherTest.php @@ -54,7 +54,7 @@ class UrlMatcherTest extends TestCase */ private $url = '/foo/bar'; - public function setUp() + public function setUp(): void { $this->routeDocument = $this->createMock(RouteMock::class); $this->routeCompiled = $this->createMock(CompiledRoute::class); diff --git a/tests/Unit/Routing/ChainRouterTest.php b/tests/Unit/Routing/ChainRouterTest.php index dbbc166d..862da13a 100644 --- a/tests/Unit/Routing/ChainRouterTest.php +++ b/tests/Unit/Routing/ChainRouterTest.php @@ -42,7 +42,7 @@ class ChainRouterTest extends TestCase */ private $context; - public function setUp() + public function setUp(): void { $this->router = new ChainRouter($this->createMock(LoggerInterface::class)); $this->context = $this->createMock(RequestContext::class); diff --git a/tests/Unit/Routing/ContentAwareGeneratorTest.php b/tests/Unit/Routing/ContentAwareGeneratorTest.php index 9882449a..5a70efd1 100644 --- a/tests/Unit/Routing/ContentAwareGeneratorTest.php +++ b/tests/Unit/Routing/ContentAwareGeneratorTest.php @@ -538,9 +538,9 @@ public function testSupports(): void public function testGetRouteDebugMessage(): void { - $this->assertContains('/some/content', $this->generator->getRouteDebugMessage(RouteObjectInterface::OBJECT_BASED_ROUTE_NAME, ['content_id' => '/some/content'])); - $this->assertContains('Route aware content Symfony\Cmf\Component\Routing\Tests\Routing\RouteAware', $this->generator->getRouteDebugMessage(RouteObjectInterface::OBJECT_BASED_ROUTE_NAME, [RouteObjectInterface::ROUTE_OBJECT => new RouteAware()])); - $this->assertContains('/some/content', $this->generator->getRouteDebugMessage('/some/content')); + $this->assertStringContainsString('/some/content', $this->generator->getRouteDebugMessage(RouteObjectInterface::OBJECT_BASED_ROUTE_NAME, ['content_id' => '/some/content'])); + $this->assertStringContainsString('Route aware content Symfony\Cmf\Component\Routing\Tests\Routing\RouteAware', $this->generator->getRouteDebugMessage(RouteObjectInterface::OBJECT_BASED_ROUTE_NAME, [RouteObjectInterface::ROUTE_OBJECT => new RouteAware()])); + $this->assertStringContainsString('/some/content', $this->generator->getRouteDebugMessage('/some/content')); } /** @@ -548,9 +548,9 @@ public function testGetRouteDebugMessage(): void */ public function testGetRouteDebugMessageLegacy(): void { - $this->assertContains('/some/content', $this->generator->getRouteDebugMessage(null, ['content_id' => '/some/content'])); - $this->assertContains('Route aware content Symfony\Cmf\Component\Routing\Tests\Routing\RouteAware', $this->generator->getRouteDebugMessage(new RouteAware())); - $this->assertContains('/some/content', $this->generator->getRouteDebugMessage('/some/content')); + $this->assertStringContainsString('/some/content', $this->generator->getRouteDebugMessage(null, ['content_id' => '/some/content'])); + $this->assertStringContainsString('Route aware content Symfony\Cmf\Component\Routing\Tests\Routing\RouteAware', $this->generator->getRouteDebugMessage(new RouteAware())); + $this->assertStringContainsString('/some/content', $this->generator->getRouteDebugMessage('/some/content')); } } diff --git a/tests/Unit/Routing/DynamicRouterTest.php b/tests/Unit/Routing/DynamicRouterTest.php index 48c4faba..df0a2500 100644 --- a/tests/Unit/Routing/DynamicRouterTest.php +++ b/tests/Unit/Routing/DynamicRouterTest.php @@ -70,7 +70,7 @@ class DynamicRouterTest extends TestCase const URL = '/foo/bar'; - public function setUp() + public function setUp(): void { $this->routeDocument = $this->createMock(RouteMock::class); @@ -157,7 +157,7 @@ public function testSupportsNonversatile() { $generator = $this->createMock(UrlGeneratorInterface::class); $router = new DynamicRouter($this->context, $this->matcher, $generator); - $this->assertInternalType('string', $router->getRouteDebugMessage('test')); + $this->assertIsString($router->getRouteDebugMessage('test')); $this->assertTrue($router->supports('some string')); $this->assertFalse($router->supports($this)); @@ -328,7 +328,7 @@ public function testRouteDebugMessageNonversatile() { $generator = $this->createMock(UrlGeneratorInterface::class); $router = new DynamicRouter($this->context, $this->matcher, $generator); - $this->assertInternalType('string', $router->getRouteDebugMessage('test')); + $this->assertIsString($router->getRouteDebugMessage('test')); } /** diff --git a/tests/Unit/Routing/PagedRouteCollectionTest.php b/tests/Unit/Routing/PagedRouteCollectionTest.php index f5b0816c..cf8cd518 100644 --- a/tests/Unit/Routing/PagedRouteCollectionTest.php +++ b/tests/Unit/Routing/PagedRouteCollectionTest.php @@ -29,7 +29,7 @@ class PagedRouteCollectionTest extends TestCase */ private $routeProvider; - protected function setUp() + protected function setUp(): void { $this->routeProvider = $this->createMock(PagedRouteProviderInterface::class); } diff --git a/tests/Unit/Routing/ProviderBasedGeneratorTest.php b/tests/Unit/Routing/ProviderBasedGeneratorTest.php index fd861238..13e39594 100644 --- a/tests/Unit/Routing/ProviderBasedGeneratorTest.php +++ b/tests/Unit/Routing/ProviderBasedGeneratorTest.php @@ -143,10 +143,10 @@ public function testSupports(): void public function testGetRouteDebugMessage(): void { - $this->assertContains('/some/key', $this->generator->getRouteDebugMessage(new RouteObject())); - $this->assertContains('/de/test', $this->generator->getRouteDebugMessage(new Route('/de/test'))); - $this->assertContains('/some/route', $this->generator->getRouteDebugMessage('/some/route')); - $this->assertContains('a:1:{s:10:"route_name";s:7:"example";}', $this->generator->getRouteDebugMessage(['route_name' => 'example'])); + $this->assertStringContainsString('/some/key', $this->generator->getRouteDebugMessage(new RouteObject())); + $this->assertStringContainsString('/de/test', $this->generator->getRouteDebugMessage(new Route('/de/test'))); + $this->assertStringContainsString('/some/route', $this->generator->getRouteDebugMessage('/some/route')); + $this->assertStringContainsString('a:1:{s:10:"route_name";s:7:"example";}', $this->generator->getRouteDebugMessage(['route_name' => 'example'])); } /**