8000 Fix 7.2 compat layer · pierredup/symfony@fdf285b · GitHub
[go: up one dir, main page]

Skip to con 8000 tent

Commit fdf285b

Browse files
Fix 7.2 compat layer
1 parent e229dd0 commit fdf285b

File tree

19 files changed

+55
-86
lines changed

19 files changed

+55
-86
lines changed

.github/build-packages.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
$dirs = $_SERVER['argv'];
1010
array_shift($dirs);
1111
$mergeBase = trim(shell_exec(sprintf('git merge-base %s HEAD', array_shift($dirs))));
12+
1213
$packages = array();
1314
$flags = \PHP_VERSION_ID >= 50400 ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE : 0;
1415

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ matrix:
2525
- php: 5.5
2626
- php: 5.6
2727
- php: 7.0
28-
env: deps=high
2928
- php: 7.1
29+
env: deps=high
3030
- php: 7.2
31+
env: deps=low
3132
fast_finish: true
3233

3334
cache:
@@ -137,7 +138,7 @@ install:
137138
export SYMFONY_DEPRECATIONS_HELPER=weak &&
138139
cp composer.json composer.json.orig &&
139140
echo -e '{\n"require":{'"$(grep phpunit-bridge composer.json)"'"php":"*"},"minimum-stability":"dev"}' > composer.json &&
140-
(php .github/build-packages.php HEAD^ $COMPONENTS) &&
141+
php .github/build-packages.php HEAD^ $COMPONENTS &&
141142
mv composer.json composer.json.phpunit &&
142143
mv composer.json.orig composer.json
143144
fi
@@ -176,9 +177,9 @@ install:
176177
if [[ $skip ]]; then
177178
echo -e "\\n\\e[1;34mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m"
178179
elif [[ $deps = high ]]; then
179-
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && ($COMPOSER_UP) && $PHPUNIT_X$LEGACY'"
180+
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && $COMPOSER_UP && $PHPUNIT_X$LEGACY'"
180181
elif [[ $deps = low ]]; then
181-
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && ($COMPOSER_UP --prefer-lowest --prefer-stable) && $PHPUNIT_X'"
182+
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && $COMPOSER_UP --prefer-lowest --prefer-stable && $PHPUNIT_X'"
182183
elif [[ $PHP = hhvm* ]]; then
183184
$PHPUNIT --exclude-group benchmark,intl-data
184185
else

src/Symfony/Bridge/Twig/Tests/AppVariableTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ public function testEnvironment()
4444
$this->assertEquals('dev', $this->appVariable->getEnvironment());
4545
}
4646

47+
/**
48+
* @runInSeparateProcess
49+
*/
4750
public function testGetSession()
4851
{
4952
$request = $this->getMockBuilder('Symfony\Component\HttpFoundation\Request')->getMock();

src/Symfony/Bridge/Twig/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"symfony/asset": "~2.7",
2424
"symfony/finder": "~2.3",
2525
"symfony/form": "~2.7.30|^2.8.23",
26+
"symfony/http-foundation": "~2.7.36|^2.8.29",
2627
"symfony/http-kernel": "~2.3",
2728
"symfony/intl": "~2.3",
2829
"symfony/routing": "~2.2",

src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function testCacheIsFreshAfterCacheClearedWithWarmup()
5555
$finder = new Finder();
5656
$metaFiles = $finder->files()->in($this->kernel->getCacheDir())->name('*.php.meta');
5757
// simply check that cache is warmed up
58-
$this->assertGreaterThanOrEqual(1, count($metaFiles));
58+
$this->assertNotEmpty($metaFiles);
5959
foreach ($metaFiles as $file) {
6060
$configCache = new ConfigCache(substr($file, 0, -5), true);
6161
$this->assertTrue(

src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ public function testRedirectToRoute()
143143
$this->assertSame(302, $response->getStatusCode());
144144
}
145145

146+
/**
147+
* @runInSeparateProcess
148+
*/
146149
public function testAddFlash()
147150
{
148151
$flashBag = new FlashBag();

src/Symfony/Bundle/FrameworkBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"symfony/config": "~2.4",
2424
"symfony/event-dispatcher": "~2.5",
2525
"symfony/finder": "^2.0.5",
26-
"symfony/http-foundation": "~2.7",
26+
"symfony/http-foundation": "~2.7.36|^2.8.29",
2727
"symfony/http-kernel": "~2.7.29|^2.8.22",
2828
"symfony/filesystem": "~2.3",
2929
"symfony/routing": "~2.7.24|^2.8.17",

src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ public function testNotice()
7979
$this->assertEquals(E_NOTICE, $exception->getSeverity());
8080
$this->assertEquals(__FILE__, $exception->getFile());
8181
$this->assertRegExp('/^Notice: Undefined variable: (foo|bar)/', $exception->getMessage());
82-
$this->assertArrayHasKey('foobar', $exception->getContext());
82+
if (\PHP_VERSION_ID < 70200) {
83+
$this->assertArrayHasKey('foobar', $exception->getContext());
84+
}
8385

8486
$trace = $exception->getTrace();
8587
$this->assertEquals(__FILE__, $trace[0]['file']);
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

3-
throw new \Exception('boo');
3+
if (!function_exists('__phpunit_run_isolated_test')) {
4+
throw new \Exception('boo');
5+
}

src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,9 @@ public function testExtensionInPhar()
421421
if (extension_loaded('suhosin') && false === strpos(ini_get('suhosin.executor.include.whitelist'), 'phar')) {
422422
$this->markTestSkipped('To run this test, add "phar" to the "suhosin.executor.include.whitelist" settings in your php.ini file.');
423423
}
424+
if (defined('HHVM_VERSION')) {
425+
$this->markTestSkipped('HHVM makes this test conflict with those run in separate processes.');
426+
}
424427

425428
require_once self::$fixturesPath.'/includes/ProjectWithXsdExtensionInPhar.phar';
426429

0 commit comments

Comments
 (0)
0