symfony-cmf / Routing

Routing component building on the Symfony Routing component
Other
289 stars 70 forks source link

Allow installing on PHP 8 #255

Closed andypost closed 4 years ago

andypost commented 4 years ago
Q A
Branch? "master"
Bug fix? no
New feature? yes
BC breaks? yes/no
Deprecations? yes/no
Fixed tickets comma-separated list of tickets fixed by the PR, if any
License MIT
Doc PR reference to the documentation PR, if any
andypost commented 4 years ago

Locally on phpunit 9 and php 8 beta3 as ter patches I'm getting

make test

+++ run unit tests +++
PHPUnit 9.3.8 by Sebastian Bergmann and contributors.

Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!

Testing 
.R...W..................................W................SSS...  63 / 130 ( 48%)
..S..............S................................WWWWWWW...... 126 / 130 ( 96%)
....                                                            130 / 130 (100%)

Time: 00:00.165, Memory: 8.00 MB

There were 9 warnings:

1) Symfony\Cmf\Component\Routing\Tests\Unit\DependencyInjection\Compiler\RegisterRouteEnhancersPassTest::testRouteEnhancerPass
The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.

2) Symfony\Cmf\Component\Routing\Tests\Routing\ChainRouterTest::testReSortRouters
The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.

3) Symfony\Cmf\Component\Routing\PagedRouteCollectionTest::testIterator with data set #0 (0, 20, array(array(0, 20)))
The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.

4) Symfony\Cmf\Component\Routing\PagedRouteCollectionTest::testIterator with data set #1 (10, 20, array(array(0, 20)))
The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.

5) Symfony\Cmf\Component\Routing\PagedRouteCollectionTest::testIterator with data set #2 (20, 20, array(array(0, 20), array(20, 20)))
The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.

6) Symfony\Cmf\Component\Routing\PagedRouteCollectionTest::testIterator with data set #3 (39, 20, array(array(0, 20), array(20, 20)))
The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.

7) Symfony\Cmf\Component\Routing\PagedRouteCollectionTest::testIterator with data set #4 (40, 20, array(array(0, 20), array(20, 20), array(40, 20)))
The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.

8) Symfony\Cmf\Component\Routing\PagedRouteCollectionTest::testIterator with data set #5 (41, 20, array(array(0, 20), array(20, 20), array(40, 20)))
The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.

9) Symfony\Cmf\Component\Routing\PagedRouteCollectionTest::testIterator with data set #6 (42, 23, array(array(0, 23), array(23, 23)))
The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.

--

There was 1 risky test:

1) Symfony\Cmf\Component\Routing\Tests\Unit\Candidates\CandidatesTest::testRestrictQuery
This test did not perform any assertions

/srv/tests/Unit/Candidates/CandidatesTest.php:33

WARNINGS!
Tests: 130, Assertions: 681, Warnings: 9, Skipped: 5, Risky: 1.

Remaining direct deprecation notices (1)

  1x: The "Symfony\Cmf\Component\Routing\ChainRouteCollection::add()" method will require a new "int $priority" argument in the next major version of its parent class "Symfony\Component\Routing\RouteCollection", not defining it is deprecated.
    1x in ChainRouterTest::testRouteCollection from Symfony\Cmf\Component\Routing\Tests\Routing

Remaining indirect deprecation notices (1)

  1x: Since symfony/event-dispatcher 5.1: Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy is deprecated, use the event dispatcher without the proxy.
    1x in DynamicRouterTest::setUp from Symfony\Cmf\Component\Routing\Tests\Routing

Legacy deprecation notices (6)

Other deprecation notices (1)

  1x: The Symfony\Cmf\Component\Routing\VersatileGeneratorInterface::supports method is deprecated (This method is deprecated since version 2.3 and will be removed in version 3.O.  This method was used to not call generators that can not handle objects in $name. With Symfony 5, this becomes obsolete as the strict type declaration prevents passing anything else than a string as $name.).
    1x in ChainRouterTest::testGenerateWithObjectNameInParametersNotFoundVersatile from Symfony\Cmf\Component\Routing\Tests\Routing

make: *** [vendor/symfony-cmf/testing/bin/make/unit_tests.mk:5: unit_tests] Error 1
andypost commented 4 years ago

Another compatibility fix in separate https://github.com/symfony-cmf/Routing/pull/256

dbu commented 4 years ago

i have just merged #256, please rebase this branch ;-)

andypost commented 4 years ago

After changing travis to nightly tests started to work

New issues

andypost commented 4 years ago

Filed https://github.com/symfony-cmf/Routing/pull/259 for TestCase::at()

andypost commented 4 years ago

The remaining one is related to https://github.com/sebastianbergmann/phpunit/issues/4373 Looks phpunit should be 9.3 to pass on php 8 https://github.com/sebastianbergmann/phpunit/issues/4325

dbu commented 4 years ago

great, this is green now! i wonder if we want to merge with php 8 nightly, or wait for a stable php 8 to be released first? as the nightly is only in the travis configuration it has no effect on consumers, so i would be ok to merge it now. wdyt @andypost ?

dbu commented 4 years ago

i tagged https://github.com/symfony-cmf/Routing/releases/tag/2.3.3, thanks a lot!