From 55fe51aee9d08221b761c9c787b5b1d5910a29cf Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 2 Aug 2019 16:07:32 +0200 Subject: [PATCH] Run the phpunit-bridge from a PR --- .travis.yml | 14 ++++++++++++++ composer.json | 2 +- .../Debug/Tests/Exception/FlattenExceptionTest.php | 5 ++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c1e2cfd8b566f..7683dabe10b3e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -194,6 +194,18 @@ before_install: fi install: + - | + # Install the phpunit-bridge from a PR if required + # + # To run a PR with a patched phpunit-bridge, first submit the path for the + # phpunit-bridge as a separate PR against the next feature branch then + # uncomment and update the following line with the PR number and change the + # required version of the bridge in the root composer.json to the version + # of the next feature version (e.g "symfony/phpunit-bridge": "4.4.x@dev") + git fetch origin refs/pull/32886/head + git rm -rq src/Symfony/Bridge/PhpUnit + git checkout -q FETCH_HEAD -- src/Symfony/Bridge/PhpUnit + - | # Create local composer packages for each patched components and reference them in composer.json files when cross-testing components if [[ ! $deps ]]; then @@ -206,6 +218,8 @@ install: mv composer.json composer.json.phpunit && mv composer.json.orig composer.json fi + git rm -fq -- src/Symfony/Bridge/PhpUnit/composer.json + git diff --staged -- src/Symfony/Bridge/PhpUnit/ | git apply -R --index - | # For the master branch, when deps=high, the version before master is checked out and tested with the locally patched components diff --git a/composer.json b/composer.json index 919941f984d6b..505f1e234aee0 100644 --- a/composer.json +++ b/composer.json @@ -98,7 +98,7 @@ "ocramius/proxy-manager": "~0.4|~1.0|~2.0", "predis/predis": "~1.0", "egulias/email-validator": "~1.2,>=1.2.8|~2.0", - "symfony/phpunit-bridge": "^3.4.19|^4.1.8|~5.0", + "symfony/phpunit-bridge": "4.4.x@dev", "symfony/security-acl": "~2.8|~3.0", "phpdocumentor/reflection-docblock": "^3.0|^4.0" }, diff --git a/src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php b/src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php index f755a78cfcb52..eff43f8c66f76 100644 --- a/src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php +++ b/src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Debug\Tests\Exception; use PHPUnit\Framework\TestCase; +use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait; use Symfony\Component\Debug\Exception\FlattenException; use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; @@ -31,6 +32,8 @@ class FlattenExceptionTest extends TestCase { + use ForwardCompatTestTrait; + public function testStatusCode() { $flattened = FlattenException::create(new \RuntimeException(), 403); @@ -256,7 +259,7 @@ function () {}, // assertEquals() does not like NAN values. $this->assertEquals($array[$i][0], 'float'); - $this->assertTrue(is_nan($array[$i++][1])); + $this->assertNan($array[$i++][1]); } public function testRecursionInArguments()