This commit is contained in:
Nicolas Grekas 2018-11-21 12:58:55 +01:00
parent c40cf26c5f
commit cb8302cb76
5 changed files with 25 additions and 15 deletions

View File

@ -1,5 +1,5 @@
build: false
clone_depth: 1
clone_depth: 2
clone_folder: c:\projects\symfony
cache:

View File

@ -6,9 +6,14 @@ if (3 > $_SERVER['argc']) {
}
chdir(dirname(__DIR__));
$json = ltrim(file_get_contents('composer.json'));
if ($json !== $package = preg_replace('/\n "repositories": \[\n.*?\n \],/s', '', $json)) {
file_put_contents('composer.json', $package);
}
$dirs = $_SERVER['argv'];
array_shift($dirs);
$mergeBase = trim(shell_exec(sprintf('git merge-base %s HEAD', array_shift($dirs))));
$mergeBase = trim(shell_exec(sprintf('git merge-base "%s" HEAD', array_shift($dirs))));
$packages = array();
$flags = \PHP_VERSION_ID >= 50400 ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE : 0;
@ -49,7 +54,7 @@ foreach ($dirs as $k => $dir) {
$packages[$package->name][$package->version] = $package;
$versions = file_get_contents('https://packagist.org/p/'.$package->name.'.json');
$versions = @file_get_contents('https://repo.packagist.org/p/'.$package->name.'.json') ?: sprintf('{"packages":{"%s":{"dev-master":%s}}}', $package->name, file_get_contents($dir.'/composer.json'));
$versions = json_decode($versions)->packages->{$package->name};
if ($package->version === str_replace('-dev', '.x-dev', $versions->{'dev-master'}->extra->{'branch-alias'}->{'dev-master'})) {
@ -74,8 +79,6 @@ if ($dirs) {
'type' => 'composer',
'url' => 'file://'.str_replace(DIRECTORY_SEPARATOR, '/', dirname(__DIR__)).'/',
));
if (false === strpos($json, "\n \"repositories\": [\n")) {
$json = rtrim(json_encode(array('repositories' => $package->repositories), $flags), "\n}").','.substr($json, 1);
file_put_contents('composer.json', $json);
}
$json = rtrim(json_encode(array('repositories' => $package->repositories), $flags), "\n}").','.substr($json, 1);
file_put_contents('composer.json', $json);
}

View File

@ -79,7 +79,7 @@ foreach ($composerJsons as list($dir, $lockedPackages)) {
continue 2;
}
if (isset($composerJsons[$name][2]['repositories']) && !isset($lockedJson[$key]['repositories'])) {
if (isset($composerJsons[$name][2]['repositories']) && !isset($lockedJson['repositories'])) {
// the locked package has been patched locally but the lock references a commit,
// which means the referencing package itself is not modified
continue;
@ -104,8 +104,7 @@ foreach ($composerJsons as list($dir, $lockedPackages)) {
}
}
if (!$referencedCommits || (isset($_SERVER['TRAVIS_PULL_REQUEST']) && 'false' !== $_SERVER['TRAVIS_PULL_REQUEST'])) {
// cached commits cannot be stale for PRs
if (!$referencedCommits) {
return;
}

View File

@ -1,10 +1,9 @@
language: php
dist: trusty
sudo: false
git:
depth: 1
depth: 2
addons:
apt_packages:
@ -159,7 +158,7 @@ before_install:
echo extension = $ext_cache >> $INI
elif [[ $PHP = 7.* ]]; then
tfold ext.apcu tpecl apcu-5.1.6 apcu.so $INI
tfold ext.mongodb tpecl mongodb-1.5.0 mongodb.so $INI
tfold ext.mongodb tpecl mongodb-1.5.2 mongodb.so $INI
fi
done
@ -218,10 +217,14 @@ install:
fi
phpenv global ${PHP/hhvm*/hhvm}
if [[ $PHP = 7.* ]]; then
([[ $deps ]] && cd src/Symfony/Component/HttpFoundation; composer config platform.ext-mongodb 1.5.0; composer require --dev --no-update mongodb/mongodb)
([[ $deps ]] && cd src/Symfony/Component/HttpFoundation; composer config platform.ext-mongodb 1.5.2; composer require --dev --no-update mongodb/mongodb)
fi
tfold 'composer update' $COMPOSER_UP
tfold 'phpunit install' ./phpunit install
if [[ $TRAVIS_PHP_VERSION = 5.* || $TRAVIS_PHP_VERSION = hhvm* ]]; then
tfold 'phpunit install' 'composer global remove symfony/flex && ./phpunit install && composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-master'
else
tfold 'phpunit install' ./phpunit install
fi
if [[ $deps = high ]]; then
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && $COMPOSER_UP && $PHPUNIT_X$LEGACY'"
elif [[ $deps = low ]]; then

View File

@ -1509,4 +1509,9 @@ class EntityTypeTest extends BaseTypeTest
$this->assertEquals(array(), $form->getNormData());
$this->assertSame(array(), $form->getViewData(), 'View data is always an array');
}
public function testSubmitNullUsesDefaultEmptyData($emptyData = 'empty', $expectedData = null)
{
$this->markTestIncomplete('Added in symfony/form 2.8.');
}
}