8000 minor #16443 [travis] session.gc_probability=0 to fix transient tests… · symfony/symfony@38a92c8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 38a92c8

Browse files
committed
minor #16443 [travis] session.gc_probability=0 to fix transient tests on hhvm (nicolas-grekas)
This PR was merged into the 2.3 branch. Discussion ---------- [travis] session.gc_probability=0 to fix transient tests on hhvm | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #15617 | License | MIT | Doc PR | - Should fix tests failing with: `ps_files_cleanup_dir: opendir(/var/lib/hhvm/sessions) failed: Permission denied (13)` Commits ------- b4dd254 [travis] session.gc_probability=0 to fix transient tests on hhvm
2 parents 27f7be6 + b4dd254 commit 38a92c8

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

.travis.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ env:
3232

3333
before_install:
3434
- if [[ "$deps" = "no" ]] && [[ "$TRAVIS_PHP_VERSION" =~ 5.[45] ]] && [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then export deps=skip; fi;
35+
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then INI_FILE=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; else INI_FILE=/etc/hhvm/php.ini; fi;
36+
- echo "memory_limit = -1" >> $INI_FILE
37+
- echo "session.gc_probability = 0" >> $INI_FILE
3538
- if [ "$deps" != "skip" ]; then composer self-update; fi;
36-
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
3739
- if [[ "$TRAVIS_PHP_VERSION" = 5.* ]]; then phpenv config-rm xdebug.ini; fi;
38-
- if [[ "$TRAVIS_PHP_VERSION" = 5.* ]]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
39-
- if [[ "$TRAVIS_PHP_VERSION" = 5.* ]]; then echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
40-
- if [[ "$TRAVIS_PHP_VERSION" = 5.* ]]; then (echo yes | pecl install -f apcu-4.0.7 && echo "apc.enable_cli = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini) || echo "Let's continue without apcu extension"; fi;
40+
- if [[ "$TRAVIS_PHP_VERSION" = 5.* ]]; then echo "extension = mongo.so" >> $INI_FILE; fi;
41+
- if [[ "$TRAVIS_PHP_VERSION" = 5.* ]]; then echo "extension = memcache.so" >> $INI_FILE; fi;
42+
- if [[ "$TRAVIS_PHP_VERSION" = 5.* ]]; then (echo yes | pecl install -f apcu-4.0.7 && echo "apc.enable_cli = 1" >> $INI_FILE) || echo "Let's continue without apcu extension"; fi;
4143
- if [[ "$TRAVIS_PHP_VERSION" = 5.* ]]; then pecl install -f memcached-2.1.0 || echo "Let's continue without memcached extension"; fi;
42-
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then php -i; fi;
44+
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi;
4345
- if [ "$deps" != "skip" ]; then ./phpunit install; fi;
4446
- export PHPUNIT="$(readlink -f ./phpunit)"
4547

src/Symfony/Component/HttpKernel/Tests/Fragment/FragmentHandlerTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,20 @@
1414
use Symfony\Component\HttpKernel\Fragment\FragmentHandler;
1515
use Symfony\Component\HttpFoundation\Request;
1616
use Symfony\Component\HttpFoundation\Response;
17+
use Symfony\Bridge\PhpUnit\ClockMock;
1718

1819
/**
1920
* @group time-sensitive
2021
*/
2122
class FragmentHandlerTest extends \PHPUnit_Framework_TestCase
2223
{
24+
protected function setUp()
25+
{
26+
if (class_exists('Symfony\Bridge\PhpUnit\ClockMock')) {
27+
ClockMock::register('Symfony\Component\HttpFoundation\Request');
28+
}
29+
}
30+
2331
/**
2432
* @expectedException \InvalidArgumentException
2533
*/

0 commit comments

Comment 3162 s
 (0)
0