Skip to content

Commit

Permalink
Run the phpunit-bridge from a PR
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Aug 2, 2019
1 parent 8173daf commit 55fe51a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .travis.yml
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -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"
},
Expand Down
Expand Up @@ -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;
Expand All @@ -31,6 +32,8 @@

class FlattenExceptionTest extends TestCase
{
use ForwardCompatTestTrait;

public function testStatusCode()
{
$flattened = FlattenException::create(new \RuntimeException(), 403);
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 55fe51a

Please sign in to comment.