Skip to content

Commit 676efd2

Browse files
authored
Fix travis build (#4)
* Fix pecl install of swoole in non-interactive environment * Don't build on PHP 7.0, as Swoole requires at least 7.1 * Bump PHP version constraint * Fix tests to play nice with 4ecb153
1 parent 4ecb153 commit 676efd2

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ cache:
88

99
matrix:
1010
include:
11-
- php: '7.0'
1211
- php: '7.1'
1312
- php: '7.2'
1413
- php: '7.2'
1514
env: deps=low
1615

1716
before_install:
18-
- pecl install swoole
17+
- yes "" | pecl install swoole
1918
- echo "extension=swoole.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
2019
- composer self-update
2120

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
}
2121
},
2222
"require": {
23-
"php": "^7.0",
23+
"php": "^7.1",
2424
"symfony/http-foundation": "^2.7 || ^3.0 || ^4.0"
2525
},
2626
"require-dev": {

tests/Symfony/ResponseTest.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,23 @@
2020
*/
2121
class ResponseTest extends TestCase
2222
{
23-
public function testWriteResponse()
23+
public function testWriteResponseWithEnd()
2424
{
2525
$sfResponse = new SfResponse();
2626

2727
$swooleResponse = $this->createMock(\Swoole\Http\Response::class);
28-
$swooleResponse->expects($this->once())->method('write');
2928

30-
Response::writeSwooleResponse($swooleResponse, $sfResponse);
29+
$swooleResponse->expects($this->once())->method('end');
30+
Response::writeSwooleResponse($swooleResponse, $sfResponse, true);
31+
}
32+
33+
public function testWriteResponseWithoutEnd()
34+
{
35+
$sfResponse = new SfResponse();
36+
37+
$swooleResponse = $this->createMock(\Swoole\Http\Response::class);
38+
39+
$swooleResponse->expects($this->once())->method('write');
40+
Response::writeSwooleResponse($swooleResponse, $sfResponse, false);
3141
}
3242
}

0 commit comments

Comments
 (0)