File tree 4 files changed +19
-13
lines changed
Filter options
4 files changed +19
-13
lines changed
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ sudo: false
5
5
cache :
6
6
directories :
7
7
- $HOME/.composer/cache/files
8
+ - $HOME/symfony-bridge/.phpunit
8
9
9
10
matrix :
10
11
include :
@@ -13,9 +14,9 @@ matrix:
13
14
- php : 5.5
14
15
- php : 5.6
15
16
- php : 5.3
16
- env : deps=low
17
+ env : COMPOSER_OPTIONS="--prefer-lowest --prefer-stable" SYMFONY_DEPRECATIONS_HELPER=weak
17
18
- php : 5.6
18
- env : deps=high
19
+ env : COMPOSER_OPTIONS="" SYMFONY_DEPRECATIONS_HELPER=weak
19
20
- php : 7.0
20
21
- php : hhvm
21
22
allow_failures :
@@ -25,7 +26,9 @@ matrix:
25
26
env :
26
27
global :
27
28
- 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"
29
32
30
33
before_install :
31
34
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then phpenv config-rm xdebug.ini; fi;
@@ -37,10 +40,8 @@ before_install:
37
40
38
41
install :
39
42
- 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
44
45
45
46
script :
46
- - phpunit
47
+ - vendor/bin/simple- phpunit
Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Bridge \PsrHttpMessage \Tests \Factory ;
13
13
14
+ use PHPUnit \Framework \TestCase ;
14
15
use Symfony \Bridge \PsrHttpMessage \Factory \DiactorosFactory ;
15
16
use Symfony \Component \HttpFoundation \BinaryFileResponse ;
16
17
use Symfony \Component \HttpFoundation \Cookie ;
22
23
/**
23
24
* @author Kévin Dunglas <dunglas@gmail.com>
24
25
*/
25
- class DiactorosFactoryTest extends \PHPUnit_Framework_TestCase
26
+ class DiactorosFactoryTest extends TestCase
26
27
{
27
28
private $ factory ;
28
29
private $ tmpDir ;
@@ -143,7 +144,11 @@ public function testCreateResponse()
143
144
$ this ->assertEquals ('Response content. ' , $ psrResponse ->getBody ()->__toString ());
144
145
$ this ->assertEquals (202 , $ psrResponse ->getStatusCode ());
145
146
$ 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 ]);
147
152
}
148
153
149
154
public function testCreateResponseFromStreamed ()
Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Bridge \PsrHttpMessage \Tests \Factory ;
13
13
14
+ use PHPUnit \Framework \TestCase ;
14
15
use Psr \Http \Message \UploadedFileInterface ;
15
16
use Symfony \Bridge \PsrHttpMessage \Factory \HttpFoundationFactory ;
16
17
use Symfony \Bridge \PsrHttpMessage \Tests \Fixtures \Response ;
22
23
/**
23
24
* @author Kévin Dunglas <dunglas@gmail.com>
24
25
*/
25
- class HttpFoundationFactoryTest extends \PHPUnit_Framework_TestCase
26
+ class HttpFoundationFactoryTest extends TestCase
26
27
{
27
28
/** @var HttpFoundationFactory */
28
29
private $ factory ;
@@ -198,7 +199,6 @@ public function testCreateResponse()
198
199
'theme=light ' ,
199
200
'test ' ,
200
201
'ABC=AeD; Domain=dunglas.fr; Path=/kevin; Expires=Wed, 13 Jan 2021 22:23:01 GMT; Secure; HttpOnly ' ,
201
-
202
202
),
203
203
),
204
204
new Stream ('The response body ' ),
Original file line number Diff line number Diff line change 21
21
"symfony/http-foundation" : " ~2.3|~3.0"
22
22
},
23
23
"require-dev" : {
24
- "symfony/phpunit-bridge" : " ~2.7|~3.0 "
24
+ "symfony/phpunit-bridge" : " ~3.2 "
25
25
},
26
26
"suggest" : {
27
27
"psr/http-message-implementation" : " To use the HttpFoundation factory" ,
You can’t perform that action at this time.
0 commit comments