Skip to content

Commit 5a560f1

Browse files
Merge branch '2.7' into 2.8
* 2.7: [travis] Don't use parallel on HHVM [appveyor] Ignore STATUS_HEAP_CORRUPTION errors on Windows Skip some tests on HHVM due to a PHPunit bug Use the Trusty Travis infrastructure for HHVM builds Add 3.1 to PR template branch row, remove 2.3 Improve memory efficiency
2 parents a9bce60 + a004fc7 commit 5a560f1

File tree

8 files changed

+40
-12
lines changed

8 files changed

+40
-12
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
| Q | A
22
| ------------- | ---
3-
| Branch? | "master" for new features / 2.3, 2.7, 2.8 or 3.0 for fixes
3+
| Branch? | "master" for new features / 2.7, 2.8, 3.0 or 3.1 for fixes
44
| Bug fix? | yes/no
55
| New feature? | yes/no
66
| BC breaks? | yes/no

.travis.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ env:
1717

1818
matrix:
1919
include:
20+
# Use the newer stack for HHVM as HHVM does not support Precise anymore since a long time and so Precise has an outdated version
2021
- php: hhvm
22+
sudo: required
23+
dist: trusty
24+
group: edge
2125
- php: 5.3
2226
- php: 5.4
2327
- php: 5.5
@@ -35,12 +39,13 @@ cache:
3539
services: mongodb
3640

3741
before_install:
42+
- stty cols 120
3843
- PHP=$TRAVIS_PHP_VERSION
3944
# Matrix lines for intermediate PHP versions are skipped for pull requests
40-
- if [[ ! $deps && ! $PHP = ${MIN_PHP%.*} && $PHP != hhvm && $TRAVIS_PULL_REQUEST != false ]]; then deps=skip; skip=1; fi
45+
- if [[ ! $deps && ! $PHP = ${MIN_PHP%.*} && ! $PHP = hhvm* && $TRAVIS_PULL_REQUEST != false ]]; then deps=skip; skip=1; fi
4146
# A sigchild-enabled-PHP is used to test the Process component on the lowest PHP matrix line
4247
- if [[ ! $deps && $PHP = ${MIN_PHP%.*} && ! -d php-$MIN_PHP/sapi ]]; then wget http://museum.php.net/php5/php-$MIN_PHP.tar.bz2 -O - | tar -xj; (cd php-$MIN_PHP; ./configure --enable-sigchild --enable-pcntl; make -j2); fi
43-
- if [[ $PHP != hhvm ]]; then INI_FILE=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; else INI_FILE=/etc/hhvm/php.ini; fi
48+
- if [[ ! $PHP = hhvm* ]]; then INI_FILE=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; else INI_FILE=/etc/hhvm/php.ini; fi
4449
- if [[ ! $skip ]]; then echo memory_limit = -1 >> $INI_FILE; fi
4550
- if [[ ! $skip ]]; then echo session.gc_probability = 0 >> $INI_FILE; fi
4651
- if [[ ! $skip && $PHP = 5.* ]]; then echo extension = mongo.so >> $INI_FILE; fi
@@ -49,8 +54,8 @@ before_install:
4954
- if [[ ! $skip && $PHP = 7.* ]]; then (echo yes | pecl install -f apcu-5.1.2 && echo apc.enable_cli = 1 >> $INI_FILE); fi
5055
- if [[ ! $deps && $PHP = 5.* ]]; then (cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo extension = $(pwd)/modules/symfony_debug.so >> $INI_FILE); fi
5156
- if [[ ! $skip && $PHP = 5.* ]]; then pecl install -f memcached-2.1.0; fi
52-
- if [[ ! $skip && $PHP != hhvm ]]; then echo extension = ldap.so >> $INI_FILE; fi
53-
- if [[ ! $skip && $PHP != hhvm ]]; then phpenv config-rm xdebug.ini; fi
57+
- if [[ ! $skip && ! $PHP = hhvm* ]]; then echo extension = ldap.so >> $INI_FILE; fi
58+
- if [[ ! $skip && ! $PHP = hhvm* ]]; then phpenv config-rm xdebug.ini; fi
5459
- if [[ ! $skip ]]; then composer self-update --stable; fi
5560
- if [[ ! $skip ]]; then cp .composer/* ~/.composer/; fi
5661
- if [[ ! $skip ]]; then ./phpunit install; fi
@@ -68,12 +73,13 @@ install:
6873
- export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev
6974
- if [[ ! $deps ]]; then composer update; else export SYMFONY_DEPRECATIONS_HELPER=weak; fi
7075
- if [[ $TRAVIS_BRANCH = master ]]; then export SYMFONY_PHPUNIT_OVERLOAD=1; fi
71-
- if [[ $PHP != hhvm ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi
76+
- if [[ ! $PHP = hhvm* ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi
7277

7378
script:
7479
- if [[ $skip ]]; then echo -e "\\n\\e[1;34mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m"; fi
75-
- if [[ ! $deps ]]; then echo "$COMPONENTS" | parallel --gnu '$PHPUNIT --exclude-group tty,benchmark,intl-data {}'; fi
76-
- if [[ ! $deps ]]; then echo -e "\\nRunning tests requiring tty"; $PHPUNIT --group tty; fi
80+
- if [[ ! $deps && ! $PHP = hhvm* ]]; then echo "$COMPONENTS" | parallel --gnu '$PHPUNIT --exclude-group tty,benchmark,intl-data {}'; fi
81+
- if [[ ! $deps && ! $PHP = hhvm* ]]; then echo -e "\\nRunning tests requiring tty"; $PHPUNIT --group tty; fi
82+
- if [[ ! $deps && $PHP = hhvm* ]]; then $PHPUNIT --exclude-group benchmark,intl-data; fi
7783
- if [[ ! $deps && $PHP = ${MIN_PHP%.*} ]]; then echo -e "1\\n0" | xargs -I{} sh -c 'echo "\\nPHP --enable-sigchild enhanced={}" && ENHANCE_SIGCHLD={} php-$MIN_PHP/sapi/cli/php .phpunit/phpunit-4.8/phpunit --colors=always src/Symfony/Component/Process/'; fi
7884
- if [[ $deps = high ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer update --no-progress --ansi; $PHPUNIT --exclude-group tty,benchmark,intl-data'$LEGACY; fi
7985
- if [[ $deps = low ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer update --no-progress --ansi --prefer-lowest --prefer-stable; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi

phpunit

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
5353
chdir("phpunit-$PHPUNIT_VERSION");
5454
passthru("$COMPOSER remove --no-update phpspec/prophecy");
5555
passthru("$COMPOSER remove --no-update symfony/yaml");
56+
if (5.1 <= $PHPUNIT_VERSION && $PHPUNIT_VERSION < 5.4) {
57+
passthru("$COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0\"");
58+
}
5659
passthru("$COMPOSER require --dev --no-update symfony/phpunit-bridge \">=3.1@dev\"");
5760
passthru("$COMPOSER install --prefer-dist --no-progress --ansi", $exit);
5861
if ($exit) {
@@ -170,8 +173,11 @@ if (isset($argv[1]) && 'symfony' === $argv[1]) {
170173
unlink($file);
171174
}
172175

173-
// Fail on any individual component failures but ignore STATUS_STACK_BUFFER_OVERRUN (-1073740791/0xC0000409) and STATUS_ACCESS_VIOLATION (-1073741819/0xC0000005) on Windows when APCu is enabled
174-
if ($procStatus && ('\\' !== DIRECTORY_SEPARATOR || !extension_loaded('apcu') || !ini_get('apc.enable_cli') || (-1073740791 !== $procStatus && -1073741819 !== $procStatus))) {
176+
// Fail on any individual component failures but ignore some error codes on Windows when APCu is enabled:
177+
// STATUS_STACK_BUFFER_OVERRUN (-1073740791/0xC0000409)
178+
// STATUS_ACCESS_VIOLATION (-1073741819/0xC0000005)
179+
// STATUS_HEAP_CORRUPTION (-1073740940/0xC0000374)
180+
if ($procStatus && ('\\' !== DIRECTORY_SEPARATOR || !extension_loaded('apcu') || !ini_get('apc.enable_cli') || !in_array($procStatus, array(-1073740791, -1073741819, -1073740940)))) {
175181
$exit = $procStatus;
176182
echo "\033[41mKO\033[0m $component\n\n";
177183
} else {

src/Symfony/Component/Console/Output/StreamOutput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function getStream()
7272
*/
7373
protected function doWrite($message, $newline)
7474
{
75-
if (false === @fwrite($this->stream, $message.($newline ? PHP_EOL : ''))) {
75+
if (false === @fwrite($this->stream, $message) || ($newline && (false === @fwrite($this->stream, PHP_EOL)))) {
7676
// should never happen
7777
throw new RuntimeException('Unable to write output.');
7878
}

src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcacheSessionHandlerTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ class MemcacheSessionHandlerTest extends \PHPUnit_Framework_TestCase
3030

3131
protected function setUp()
3232
{
33+
if (defined('HHVM_VERSION')) {
34+
$this->markTestSkipped('PHPUnit_MockObject cannot mock the Memcache class on HHVM. See https://github.com/sebastianbergmann/phpunit-mock-objects/pull/289');
35+
}
36+
3337
parent::setUp();
3438
$this->memcache = $this->getMock('Memcache');
3539
$this->storage = new MemcacheSessionHandler(

src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ class MemcachedSessionHandlerTest extends \PHPUnit_Framework_TestCase
3131

3232
protected function setUp()
3333
{
34+
if (defined('HHVM_VERSION')) {
35+
$this->markTestSkipped('PHPUnit_MockObject cannot mock the Memcached class on HHVM. See https://github.com/sebastianbergmann/phpunit-mock-objects/pull/289');
36+
}
37+
3438
parent::setUp();
3539

3640
if (version_compare(phpversion('memcached'), '2.2.0', '>=')) {

src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ public function testReadWriteReadWithNullByte()
135135

136136
public function testReadConvertsStreamToString()
137137
{
138+
if (defined('HHVM_VERSION')) {
139+
$this->markTestSkipped('PHPUnit_MockObject cannot mock the PDOStatement class on HHVM. See https://github.com/sebastianbergmann/phpunit-mock-objects/pull/289');
140+
}
141+
138142
$pdo = new MockPdo('pgsql');
139143
$pdo->prepareResult = $this->getMock('PDOStatement');
140144

@@ -152,6 +156,10 @@ public function testReadConvertsStreamToString()
152156

153157
public function testReadLockedConvertsStreamToString()
154158
{
159+
if (defined('HHVM_VERSION')) {
160+
$this->markTestSkipped('PHPUnit_MockObject cannot mock the PDOStatement class on HHVM. See https://github.com/sebastianbergmann/phpunit-mock-objects/pull/289');
161+
}
162+
155163
$pdo = new MockPdo('pgsql');
156164
$selectStmt = $this->getMock('PDOStatement');
157165
$insertStmt = $this->getMock('PDOStatement');

src/Symfony/Component/HttpKernel/Tests/DataCollector/DumpDataCollectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function testFlush()
128128
$line = __LINE__ - 1;
129129

130130
ob_start();
131-
$collector = null;
131+
$collector->__destruct();
132132
if (PHP_VERSION_ID >= 50400) {
133133
$this->assertSame("DumpDataCollectorTest.php on line {$line}:\n456\n", ob_get_clean());
134134
} else {

0 commit comments

Comments
 (0)