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

Appearance settings

Commit 19905b0

Browse filesBrowse files
ajgarlagnicolas-grekas
authored andcommitted
Fix tests
1 parent 921f866 commit 19905b0
Copy full SHA for 19905b0

File tree

4 files changed

+28
-11
lines changed
Filter options

4 files changed

+28
-11
lines changed

‎.travis.yml

Copy file name to clipboardExpand all lines: .travis.yml
+8-6Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ env:
99
global:
1010
- PHPUNIT_FLAGS="-v"
1111
- SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"
12-
- DEPENDENCIES="zendframework/zend-diactoros:^1.4.1 http-interop/http-factory-diactoros:^1.0"
12+
- DEPENDENCIES="nyholm/psr7:^1.1"
1313

1414
matrix:
1515
fast_finish: true
1616
include:
1717
# Minimum supported dependencies with the latest and oldest PHP version
18-
- php: 7.2
18+
- php: 7.3
1919
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors"
2020
- php: 5.3
2121
dist: 'precise'
@@ -24,27 +24,29 @@ matrix:
2424
# Test the latest stable release
2525
- php: 5.3
2626
dist: 'precise'
27-
env: DEPENDENCIES=""
27+
env: DEPENDENCIES="symfony/phpunit-bridge:>=3.4,<3.4.22||>=4.0,<4.1.11||>=4.2,<4.2.3"
2828
- php: 5.4
2929
env: DEPENDENCIES="zendframework/zend-diactoros:^1.4.1"
3030
- php: 5.5
3131
env: DEPENDENCIES="zendframework/zend-diactoros:^1.4.1"
3232
- php: 5.6
3333
env: DEPENDENCIES="zendframework/zend-diactoros:^1.4.1"
3434
- php: 7.0
35+
env: DEPENDENCIES="zendframework/zend-diactoros:^1.4.1 http-interop/http-factory-diactoros:^1.0"
3536
- php: 7.1
3637
- php: 7.2
38+
- php: 7.3
3739
env: COVERAGE=true PHPUNIT_FLAGS="-v --coverage-text"
3840

3941
# Test LTS versions. This makes sure we do not use Symfony packages with version greater
4042
# than 2 or 3 respectively.
41-
- php: 7.2
43+
- php: 7.3
4244
env: DEPENDENCIES="$DEPENDENCIES symfony/lts:^2 symfony/force-lowest:~2.8.0"
43-
- php: 7.2
45+
- php: 7.3
4446
env: DEPENDENCIES="$DEPENDENCIES symfony/lts:^3 symfony/force-lowest:~3.4.0"
4547

4648
# Latest commit to master
47-
- php: 7.2
49+
- php: 7.3
4850
env: STABILITY="dev"
4951

5052
allow_failures:

‎Tests/Factory/AbstractHttpMessageFactoryTest.php

Copy file name to clipboardExpand all lines: Tests/Factory/AbstractHttpMessageFactoryTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function testCreateResponse()
149149
202,
150150
array('X-Symfony' => array('3.4'))
151151
);
152-
$response->headers->setCookie(new Cookie('city', 'Lille', new \DateTime('Wed, 13 Jan 2021 22:23:01 GMT'), '/', null, false, true, false, ''));
152+
$response->headers->setCookie(new Cookie('city', 'Lille', new \DateTime('Wed, 13 Jan 2021 22:23:01 GMT'), '/', null, false, true, false, 'lax'));
153153

154154
$psrResponse = $this->factory->createResponse($response);
155155
$this->assertEquals('Response content.', $psrResponse->getBody()->__toString());

‎Tests/Factory/PsrHttpFactoryTest.php

Copy file name to clipboardExpand all lines: Tests/Factory/PsrHttpFactoryTest.php
+18-2Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111

1212
namespace Symfony\Bridge\PsrHttpMessage\Tests\Factory;
1313

14+
use Http\Factory\Diactoros\ResponseFactory;
15+
use Http\Factory\Diactoros\ServerRequestFactory;
16+
use Http\Factory\Diactoros\StreamFactory;
17+
use Http\Factory\Diactoros\UploadedFileFactory;
1418
use Nyholm\Psr7\Factory\Psr17Factory;
1519
use Symfony\Bridge\PsrHttpMessage\Factory\PsrHttpFactory;
1620

@@ -22,8 +26,20 @@ class PsrHttpFactoryTest extends AbstractHttpMessageFactoryTest
2226
{
2327
protected function buildHttpMessageFactory()
2428
{
25-
$factory = new Psr17Factory();
29+
if (class_exists('Nyholm\Psr7\Factory\Psr17Factory')) {
30+
$factory = new Psr17Factory();
31+
return new PsrHttpFactory($factory, $factory, $factory, $factory);
32+
}
2633

27-
return new PsrHttpFactory($factory, $factory, $factory, $factory);
34+
if (class_exists('Http\Factory\Diactoros\ServerRequestFactory')) {
35+
return new PsrHttpFactory(
36+
new ServerRequestFactory(),
37+
new StreamFactory(),
38+
new UploadedFileFactory(),
39+
new ResponseFactory()
40+
);
41+
}
42+
43+
$this->markTestSkipped('No PSR-17 HTTP Factory installed.');
2844
}
2945
}

‎composer.json

Copy file name to clipboardExpand all lines: composer.json
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
"symfony/http-foundation": "^2.3.42 || ^3.4 || ^4.0"
2222
},
2323
"require-dev": {
24-
"symfony/phpunit-bridge": "^3.4 || ^4.0",
25-
"nyholm/psr7": "^1.1"
24+
"symfony/phpunit-bridge": "^3.4 || ^4.0"
2625
},
2726
"suggest": {
2827
"nyholm/psr7": "For a super lightweight PSR-7/17 implementation"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.