8000 Merge branch '2.3' into 2.7 · symfony/symfony@309ad43 · GitHub
[go: up one dir, main page]

Skip to content

Commit 309ad43

Browse files
Merge branch '2.3' into 2.7
* 2.3: [tests] Use @requires annotation when possible [ci] Enable collecting and replaying skipped tests [Process] Workaround buggy PHP warning [Console] Add additional ways to detect OS400 platform [Yaml] Allow tabs before comments at the end of a line Conflicts: composer.json src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php src/Symfony/Bridge/Monolog/composer.json src/Symfony/Bridge/Twig/composer.json src/Symfony/Bundle/FrameworkBundle/composer.json src/Symfony/Bundle/SecurityBundle/composer.json src/Symfony/Component/Asset/composer.json src/Symfony/Component/ClassLoader/Tests/LegacyApcUniversalClassLoaderTest.php src/Symfony/Component/Console/composer.json src/Symfony/Component/Debug/composer.json src/Symfony/Component/DomCrawler/composer.json src/Symfony/Component/EventDispatcher/composer.json src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php src/Symfony/Component/HttpFoundation/composer.json src/Symfony/Component/Intl/composer.json src/Symfony/Component/Routing/composer.json src/Symfony/Component/Security/composer.json src/Symfony/Component/Serializer/composer.json src/Symfony/Component/Templating/composer.json src/Symfony/Component/Translation/composer.json src/Symfony/Component/Validator/composer.json
2 parents a954fea + 4c431d6 commit 309ad43
  • EventDispatcher
  • ExpressionLanguage
  • Filesystem
  • Finder
  • Form
  • HttpFoundation
  • HttpKernel
  • Intl
  • Locale
  • OptionsResolver
  • Process
  • PropertyAccess
  • Routing
  • Security
  • Serializer
  • Stopwatch
  • Templating
  • Translation
  • Validator
  • VarDumper
  • Yaml
  • Some content is hidden

    Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

    137 files changed

    +349
    -341
    lines changed

    .travis.yml

    Lines changed: 3 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -47,8 +47,8 @@ install:
    4747
    - if [ "$deps" != "skip" ] && [ "$deps" != "no" ]; then php .travis.php $TRAVIS_COMMIT_RANGE $TRAVIS_BRANCH $COMPONENTS; fi;
    4848

    4949
    script:
    50-
    - if [ "$deps" = "no" ]; then echo "$COMPONENTS" | parallel --gnu 'echo -e "\\nRunning {} tests"; $PHPUNIT --exclude-group tty,benchmark,intl-data {}'; fi;
    50+
    - if [ "$deps" = "no" ]; then echo "$COMPONENTS" | parallel --gnu '$PHPUNIT --exclude-group tty,benchmark,intl-data {}'; fi;
    5151
    - if [ "$deps" = "no" ]; then echo -e "\\nRunning tests requiring tty"; $PHPUNIT --group tty; fi;
    52-
    - if [ "$deps" = "high" ]; then echo "$COMPONENTS" | parallel --gnu -j10% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source update; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi;
    53-
    - if [ "$deps" = "low" ]; then echo "$COMPONENTS" | parallel --gnu -j10% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source --prefer-lowest --prefer-stable update; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi;
    52+
    - if [ "$deps" = "high" ]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer --prefer-source update; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi;
    53+
    - if [ "$deps" = "low" ]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer --prefer-source --prefer-lowest --prefer-stable update; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi;
    5454
    - if [ "$deps" = "skip" ]; then echo 'This matrix line is skipped for pull requests.'; fi;

    appveyor.yml

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -14,6 +14,7 @@ init:
    1414
    - SET PHP=1
    1515
    - SET ANSICON=121x90 (121x90)
    1616
    - SET PHP_INI_MATRIX=php.ini-min php.ini-max
    17+
    - SET SYMFONY_PHPUNIT_SKIPPED_TESTS=phpunit.skipped
    1718

    1819
    install:
    1920
    - IF EXIST c:\php (SET PHP=0) ELSE (mkdir c:\php)
    @@ -32,6 +33,7 @@ install:
    3233
    - IF %PHP%==1 cd ..
    3334
    - IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
    3435
    - IF %PHP%==1 copy /Y php.ini-development php.ini-min
    36+
    - IF %PHP%==1 echo max_execution_time=1200 >> php.ini-min
    3537
    - IF %PHP%==1 echo date.timezone="UTC" >> php.ini-min
    3638
    - IF %PHP%==1 echo extension_dir=ext >> php.ini-min
    3739
    - IF %PHP%==1 echo extension=php_openssl.dll >> php.ini-min

    composer.json

    Lines changed: 0 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -68,7 +68,6 @@
    6868
    "symfony/yaml": "self.version"
    6969
    },
    7070
    "require-dev": {
    71-
    "symfony/phpunit-bridge": "self.version",
    7271
    "doctrine/data-fixtures": "1.0.*",
    7372
    "doctrine/dbal": "~2.4",
    7473
    "doctrine/orm": "~2.4,>=2.4.5",

    phpunit

    Lines changed: 14 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -28,7 +28,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit")) {
    2828
    // Build a standalone phpunit without symfony/yaml
    2929

    3030
    $oldPwd = getcwd();
    31-
    mkdir($PHPUNIT_DIR);
    31+
    @mkdir($PHPUNIT_DIR);
    3232
    chdir($PHPUNIT_DIR);
    3333
    if (extension_loaded('openssl') && ini_get('allow_url_fopen')) {
    3434
    stream_copy_to_stream(fopen("https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip", 'rb'), fopen("$PHPUNIT_VERSION.zip", 'wb'));
    @@ -41,6 +41,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit")) {
    4141
    $zip->close();
    4242
    chdir("phpunit-$PHPUNIT_VERSION");
    4343
    passthru("$COMPOSER remove --no-update symfony/yaml");
    44+
    passthru("$COMPOSER require --dev --no-update symfony/phpunit-bridge \">=2.8@dev\"");
    4445
    passthru("$COMPOSER install --prefer-source --no-progress --ansi");
    4546
    chdir($oldPwd);
    4647
    }
    @@ -76,10 +77,13 @@ if ($phpIniMatrix) {
    7677
    if (isset($argv[1]) && 'symfony' === $argv[1]) {
    7778
    // Find Symfony components in plain php for Windows portability
    7879

    79-
    $finder = new RecursiveDirectoryIterator(__DIR__.'/src/Symfony', FilesystemIterator::KEY_AS_FILENAME | FilesystemIterator::UNIX_PATHS);
    80+
    $oldPwd = getcwd();
    81+
    chdir(__DIR__);
    82+
    $finder = new RecursiveDirectoryIterator('src/Symfony', FilesystemIterator::KEY_AS_FILENAME | FilesystemIterator::UNIX_PATHS);
    8083
    $finder = new RecursiveIteratorIterator($finder);
    8184
    $finder->setMaxDepth(3);
    8285

    86+
    $skippedTests = isset($_SERVER['SYMFONY_PHPUNIT_SKIPPED_TESTS']) ? $_SERVER['SYMFONY_PHPUNIT_SKIPPED_TESTS'] : false;
    8387
    $runningProcs = array();
    8488

    8589
    foreach ($finder as $file => $fileInfo) {
    @@ -88,6 +92,10 @@ if (isset($argv[1]) && 'symfony' === $argv[1]) {
    8892

    8993
    // Run phpunit tests in parallel
    9094

    95+
    if ($skippedTests) {
    96+
    putenv("SYMFONY_PHPUNIT_SKIPPED_TESTS=$component/$skippedTests");
    97+
    }
    98+
    9199
    $c = ProcessUtils::escapeArgument($component);
    92100

    93101
    if ($proc = proc_open(sprintf($cmd, $c, " > $c/phpunit.stdout 2> $c/phpunit.stderr"), array(), $pipes)) {
    @@ -98,6 +106,7 @@ if (isset($argv[1]) && 'symfony' === $argv[1]) {
    98106
    }
    99107
    }
    100108
    }
    109+
    chdir($oldPwd);
    101110

    102111
    // Fixes for colors support on appveyor
    103112
    // See https://github.com/appveyor/ci/issues/373
    @@ -139,6 +148,9 @@ if (isset($argv[1]) && 'symfony' === $argv[1]) {
    139148
    }
    140149
    unlink($file);
    141150
    }
    151+
    if ($skippedTests) {
    152+
    @unlink("$component/$skippedTests");
    153+
    }
    142154

    143155
    if ($procStatus) {
    144156
    $exit = 1;

    phpunit.xml.dist

    Lines changed: 4 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -43,4 +43,8 @@
    4343
    </exclude>
    4444
    </whitelist>
    4545
    </filter>
    46+
    47+
    <listeners>
    48+
    <listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
    49+
    </listeners>
    4650
    </phpunit>

    src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -29,8 +29,8 @@ class DoctrineTestHelper
    2929
    */
    3030
    public static function createTestEntityManager()
    3131
    {
    32-
    if (!class_exists('PDO') || !in_array('sqlite', \PDO::getAvailableDrivers())) {
    33-
    \PHPUnit_Framework_TestCase::markTestSkipped('This test requires SQLite support in your environment');
    32+
    if (!extension_loaded('pdo_sqlite')) {
    33+
    \PHPUnit_Framework_TestCase::markTestSkipped('Extension pdo_sqlite is required.');
    3434
    }
    3535

    3636
    $config = new \Doctrine\ORM\Configuration();

    src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php

    Lines changed: 3 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -132,12 +132,11 @@ public function testLogLongString()
    132132
    ));
    133133
    }
    134134

    135+
    /**
    136+
    * @requires extension mbstring
    137+
    */
    135138
    public function testLogUTF8LongString()
    136139
    {
    137-
    if (!function_exists('mb_detect_encoding')) {
    138-
    $this->markTestSkipped('Testing log shortening of utf8 charsets requires the mb_detect_encoding() function.');
    139-
    }
    140-
    141140
    $logger = $this->getMock('Psr\\Log\\LoggerInterface');
    142141

    143142
    $dbalLogger = $this

    src/Symfony/Bridge/Doctrine/composer.json

    Lines changed: 0 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -20,7 +20,6 @@
    2020
    "doctrine/common": "~2.4"
    2121
    },
    2222
    "require-dev": {
    23-
    "symfony/phpunit-bridge": "~2.7",
    2423
    "symfony/stopwatch": "~2.2",
    2524
    "symfony/dependency-injection": "~2.2",
    2625
    "symfony/form": "~2.7,>=2.7.1",

    src/Symfony/Bridge/Doctrine/phpunit.xml.dist

    Lines changed: 4 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -25,4 +25,8 @@
    2525
    </exclude>
    2626
    </whitelist>
    2727
    </filter>
    28+
    29+
    <listeners>
    30+
    <listener class="Symfony\Bridge\PhpUnit\SkippedTestsListener" />
    31+
    </listeners>
    2832
    </phpunit>

    src/Symfony/Bridge/Monolog/composer.json

    Lines changed: 0 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -20,7 +20,6 @@
    2020
    "monolog/monolog": "~1.11"
    2121
    },
    2222
    "require-dev": {
    23-
    "symfony/phpunit-bridge": "~2.7",
    2423
    "symfony/http-kernel": "~2.4",
    2524
    "symfony/console": "~2.4",
    2625
    "symfony/event-dispatcher": "~2.2"

    0 commit comments

    Comments
     (0)
    0