8000 Merge branch '2.8' into 3.0 · symfony/symfony@ef078ca · GitHub
[go: up one dir, main page]

Skip to content

Commit ef078ca

Browse files
Merge branch '2.8' into 3.0
* 2.8: [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 document method name changes in Voter class Conflicts: .travis.yml UPGRADE-3.0.md src/Symfony/Component/HttpKernel/Tests/DataCollector/DumpDataCollectorTest.php
2 parents 7b7c9b8 + 5a560f1 commit ef078ca

File tree

9 files changed

+44
-16
lines changed

9 files changed

+44
-16
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.5
2226
- php: 5.6
2327
env: deps=high
@@ -33,12 +37,13 @@ cache:
3337
services: mongodb
3438

3539
before_install:
40+
- stty cols 120
3641
- PHP=$TRAVIS_PHP_VERSION
3742
# Matrix lines for intermediate PHP versions are skipped for pull requests
38-
- if [[ ! $deps && ! $PHP = ${MIN_PHP%.*} && $PHP != hhvm && $TRAVIS_PULL_REQUEST != false ]]; then deps=skip; skip=1; fi
43+
- if [[ ! $deps && ! $PHP = ${MIN_PHP%.*} && ! $PHP = hhvm* && $TRAVIS_PULL_REQUEST != false ]]; then deps=skip; skip=1; fi
3944
# A sigchild-enabled-PHP is used to test the Process component on the lowest PHP matrix line
4045
- 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
41-
- if [[ $PHP != hhvm ]]; then INI_FILE=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; else INI_FILE=/etc/hhvm/php.ini; fi
46+
- if [[ ! $PHP = hhvm* ]]; then INI_FILE=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; else INI_FILE=/etc/hhvm/php.ini; fi
4247
- if [[ ! $skip ]]; then echo memory_limit = -1 >> $INI_FILE; fi
4348
- if [[ ! $skip ]]; then echo session.gc_probability = 0 >> $INI_FILE; fi
4449
- if [[ ! $skip && $PHP = 5.* ]]; then echo extension = mongo.so >> $INI_FILE; fi
@@ -47,8 +52,8 @@ before_install:
4752
- if [[ ! $skip && $PHP = 7.* ]]; then (echo yes | pecl install -f apcu-5.1.2 && echo apc.enable_cli = 1 >> $INI_FILE); fi
4853
- 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
4954
- if [[ ! $skip && $PHP = 5.* ]]; then pecl install -f memcached-2.1.0; fi
50-
- if [[ ! $skip && $PHP != hhvm ]]; then echo extension = ldap.so >> $INI_FILE; fi
51-
- if [[ ! $skip && $PHP != hhvm ]]; then phpenv config-rm xdebug.ini; fi
55+
- if [[ ! $skip && ! $PHP = hhvm* ]]; then echo extension = ldap.so >> $INI_FILE; fi
56+
- if [[ ! $skip && ! $PHP = hhvm* ]]; then phpenv config-rm xdebug.ini; fi
5257
- if [[ ! $skip ]]; then composer self-update --stable; fi
5358
- if [[ ! $skip ]]; then cp .composer/* ~/.composer/; fi
5459
- if [[ ! $skip ]]; then ./phpunit install; fi
@@ -66,12 +71,13 @@ install:
6671
- export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev
6772
- if [[ ! $deps ]]; then composer update; else export SYMFONY_DEPRECATIONS_HELPER=weak; fi
6873
- if [[ $TRAVIS_BRANCH = master ]]; then export SYMFONY_PHPUNIT_OVERLOAD=1; fi
69-
- if [[ $PHP != hhvm ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi
74+
- if [[ ! $PHP = hhvm* ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi
7075

7176
script:
7277
- if [[ $skip ]]; then echo -e "\\n\\e[1;34mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m"; fi
73-
- if [[ ! $deps ]]; then echo "$COMPONENTS" | parallel --gnu '$PHPUNIT --exclude-group tty,benchmark,intl-data {}'; fi
74-
- if [[ ! $deps ]]; then echo -e "\\nRunning tests requiring tty"; $PHPUNIT --group tty; fi
78+
- if [[ ! $deps && ! $PHP = hhvm* ]]; then echo "$COMPONENTS" | parallel --gnu '$PHPUNIT --exclude-group tty,benchmark,intl-data {}'; fi
79+
- if [[ ! $deps && ! $PHP = hhvm* ]]; then echo -e "\\nRunning tests requiring tty"; $PHPUNIT --group tty; fi
80+
- if [[ ! $deps && $PHP = hhvm* ]]; then $PHPUNIT --exclude-group benchmark,intl-data; fi
7581
- 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
7682
- if [[ $deps = high ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer update --no-progress --ansi; $PHPUNIT --exclude-group tty,benchmark,intl-data'$LEGACY; fi
7783
- 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

UPGRADE-3.0.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ UPGRADE FROM 2.x to 3.0
10831083
}
10841084
```
10851085

1086-
* The `AbstractVoter::isGranted()` method have been replaced by `AbstractVoter::voteOnAttribute()`.
1086+
* The `AbstractVoter::isGranted()` method has been replaced by `Voter::voteOnAttribute()`.
10871087

10881088
Before:
10891089

@@ -1102,7 +1102,7 @@ UPGRADE FROM 2.x to 3.0
11021102
After:
11031103

11041104
```php
1105-
class MyVoter extends AbstractVoter
1105+
class MyVoter extends Voter
11061106
{
11071107
protected function voteOnAttribute($attribute, $object, TokenInterface $token)
11081108
{
@@ -1113,8 +1113,8 @@ UPGRADE FROM 2.x to 3.0
11131113
}
11141114
```
11151115

1116-
* The `supportsAttribute()` and `supportsClass()` methods of classes `AuthenticatedVoter`, `ExpressionVoter`
1117-
and `RoleVoter` have been removed.
1116+
* The `supportsAttribute()` and `supportsClass()` methods of the `AuthenticatedVoter`, `ExpressionVoter`,
1117+
and `RoleVoter` classes have been removed.
11181118

11191119
* The `intention` option was renamed to `csrf_token_id` for all the authentication listeners.
11201120

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
@@ -113,7 +113,7 @@ public function testFlush()
113113
$line = __LINE__ - 1;
114114

115115
ob_start();
116-
$collector = null;
116+
$collector->__destruct();
117117
$this->assertSame("DumpDataCollectorTest.php on line {$line}:\n456\n", ob_get_clean());
118118
}
119119
}

0 commit comments

Comments
 (0)
0