Skip to content

test suite compatibility with PHPUnit 6 #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ sudo: false
cache:
directories:
- $HOME/.composer/cache/files
- $HOME/symfony-bridge/.phpunit

matrix:
include:
Expand All @@ -13,9 +14,9 @@ matrix:
- php: 5.5
- php: 5.6
- php: 5.3
env: deps=low
env: COMPOSER_OPTIONS="--prefer-lowest --prefer-stable" SYMFONY_DEPRECATIONS_HELPER=weak
- php: 5.6
env: deps=high
env: COMPOSER_OPTIONS="" SYMFONY_DEPRECATIONS_HELPER=weak
- php: 7.0
- php: hhvm
allow_failures:
Expand All @@ -25,7 +26,9 @@ matrix:
env:
global:
- deps=no
- SYMFONY_DEPRECATIONS_HELPER=weak
- SYMFONY_DEPRECATIONS_HELPER=strict
- SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"
- COMPOSER_OPTIONS="--prefer-stable"

before_install:
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then phpenv config-rm xdebug.ini; fi;
Expand All @@ -37,10 +40,8 @@ before_install:

install:
- if [ "$TRAVIS_PHP_VERSION" != "5.3" ]; then composer require --no-update zendframework/zend-diactoros; fi;
- if [ "$deps" = "no" ]; then export SYMFONY_DEPRECATIONS_HELPER=strict; fi;
- if [ "$deps" = "no" ]; then composer --prefer-source install; fi;
- if [ "$deps" = "high" ]; then composer --prefer-source update; fi;
- if [ "$deps" = "low" ]; then composer --prefer-source --prefer-lowest --prefer-stable update; fi;
- composer update --prefer-source $COMPOSER_OPTIONS
- vendor/bin/simple-phpunit install

script:
- phpunit
- vendor/bin/simple-phpunit
9 changes: 7 additions & 2 deletions Tests/Factory/DiactorosFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Bridge\PsrHttpMessage\Tests\Factory;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\Cookie;
Expand All @@ -22,7 +23,7 @@
/**
* @author Kévin Dunglas <[email protected]>
*/
class DiactorosFactoryTest extends \PHPUnit_Framework_TestCase
class DiactorosFactoryTest extends TestCase
{
private $factory;
private $tmpDir;
Expand Down Expand Up @@ -143,7 +144,11 @@ public function testCreateResponse()
$this->assertEquals('Response content.', $psrResponse->getBody()->__toString());
$this->assertEquals(202, $psrResponse->getStatusCode());
$this->assertEquals(array('2.8'), $psrResponse->getHeader('X-Symfony'));
$this->assertEquals(array('city=Lille; expires=Wed, 13-Jan-2021 22:23:01 GMT; path=/; httponly'), $psrResponse->getHeader('Set-Cookie'));

$cookieHeader = $psrResponse->getHeader('Set-Cookie');
$this->assertInternalType('array', $cookieHeader);
$this->assertCount(1, $cookieHeader);
$this->assertRegExp('{city=Lille; expires=Wed, 13-Jan-2021 22:23:01 GMT;( max-age=\d+;)? path=/; httponly}', $cookieHeader[0]);
}

public function testCreateResponseFromStreamed()
Expand Down
4 changes: 2 additions & 2 deletions Tests/Factory/HttpFoundationFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Bridge\PsrHttpMessage\Tests\Factory;

use PHPUnit\Framework\TestCase;
use Psr\Http\Message\UploadedFileInterface;
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
use Symfony\Bridge\PsrHttpMessage\Tests\Fixtures\Response;
Expand All @@ -22,7 +23,7 @@
/**
* @author Kévin Dunglas <[email protected]>
*/
class HttpFoundationFactoryTest extends \PHPUnit_Framework_TestCase
class HttpFoundationFactoryTest extends TestCase
{
/** @var HttpFoundationFactory */
private $factory;
Expand Down Expand Up @@ -198,7 +199,6 @@ public function testCreateResponse()
'theme=light',
'test',
'ABC=AeD; Domain=dunglas.fr; Path=/kevin; Expires=Wed, 13 Jan 2021 22:23:01 GMT; Secure; HttpOnly',

),
),
new Stream('The response body'),
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"symfony/http-foundation": "~2.3|~3.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.7|~3.0"
"symfony/phpunit-bridge": "~3.2"
},
"suggest": {
"psr/http-message-implementation": "To use the HttpFoundation factory",
Expand Down