Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf5c46f0

Browse files
committed
test suite compatibility with PHPUnit 6
1 parent66085f2 commitf5c46f0

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

‎.travis.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ sudo: false
55
cache:
66
directories:
77
-$HOME/.composer/cache/files
8+
-$HOME/symfony-bridge/.phpunit
89

910
matrix:
1011
include:
@@ -13,9 +14,9 @@ matrix:
1314
-php:5.5
1415
-php:5.6
1516
-php:5.3
16-
env:deps=low
17+
env:COMPOSER_OPTIONS="--prefer-lowest --prefer-stable" SYMFONY_DEPRECATIONS_HELPER=weak
1718
-php:5.6
18-
env:deps=high
19+
env:COMPOSER_OPTIONS="" SYMFONY_DEPRECATIONS_HELPER=weak
1920
-php:7.0
2021
-php:hhvm
2122
allow_failures:
@@ -25,7 +26,9 @@ matrix:
2526
env:
2627
global:
2728
-deps=no
28-
-SYMFONY_DEPRECATIONS_HELPER=weak
29+
-SYMFONY_DEPRECATIONS_HELPER=strict
30+
-SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"
31+
-COMPOSER_OPTIONS="--prefer-stable"
2932

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

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

4546
script:
46-
-phpunit
47+
-vendor/bin/simple-phpunit

‎Tests/Factory/DiactorosFactoryTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespaceSymfony\Bridge\PsrHttpMessage\Tests\Factory;
1313

14+
usePHPUnit\Framework\TestCase;
1415
useSymfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory;
1516
useSymfony\Component\HttpFoundation\BinaryFileResponse;
1617
useSymfony\Component\HttpFoundation\Cookie;
@@ -22,7 +23,7 @@
2223
/**
2324
* @author Kévin Dunglas <dunglas@gmail.com>
2425
*/
25-
class DiactorosFactoryTestextends\PHPUnit_Framework_TestCase
26+
class DiactorosFactoryTestextendsTestCase
2627
{
2728
private$factory;
2829
private$tmpDir;
@@ -143,7 +144,11 @@ public function testCreateResponse()
143144
$this->assertEquals('Response content.',$psrResponse->getBody()->__toString());
144145
$this->assertEquals(202,$psrResponse->getStatusCode());
145146
$this->assertEquals(array('2.8'),$psrResponse->getHeader('X-Symfony'));
146-
$this->assertEquals(array('city=Lille; expires=Wed, 13-Jan-2021 22:23:01 GMT; path=/; httponly'),$psrResponse->getHeader('Set-Cookie'));
147+
148+
$cookieHeader =$psrResponse->getHeader('Set-Cookie');
149+
$this->assertInternalType('array',$cookieHeader);
150+
$this->assertCount(1,$cookieHeader);
151+
$this->assertRegExp('{city=Lille; expires=Wed, 13-Jan-2021 22:23:01 GMT;( max-age=\d+;)? path=/; httponly}',$cookieHeader[0]);
147152
}
148153

149154
publicfunctiontestCreateResponseFromStreamed()

‎Tests/Factory/HttpFoundationFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespaceSymfony\Bridge\PsrHttpMessage\Tests\Factory;
1313

14+
usePHPUnit\Framework\TestCase;
1415
usePsr\Http\Message\UploadedFileInterface;
1516
useSymfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
1617
useSymfony\Bridge\PsrHttpMessage\Tests\Fixtures\Response;
@@ -22,7 +23,7 @@
2223
/**
2324
* @author Kévin Dunglas <dunglas@gmail.com>
2425
*/
25-
class HttpFoundationFactoryTestextends\PHPUnit_Framework_TestCase
26+
class HttpFoundationFactoryTestextendsTestCase
2627
{
2728
/** @var HttpFoundationFactory */
2829
private$factory;
@@ -198,7 +199,6 @@ public function testCreateResponse()
198199
'theme=light',
199200
'test',
200201
'ABC=AeD; Domain=dunglas.fr; Path=/kevin; Expires=Wed, 13 Jan 2021 22:23:01 GMT; Secure; HttpOnly',
201-
202202
),
203203
),
204204
newStream('The response body'),

‎composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"symfony/http-foundation":"~2.3|~3.0"
2222
},
2323
"require-dev": {
24-
"symfony/phpunit-bridge":"~2.7|~3.0"
24+
"symfony/phpunit-bridge":"~3.2"
2525
},
2626
"suggest": {
2727
"psr/http-message-implementation":"To use the HttpFoundation factory",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp