Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cb8302c

Browse files
Fix CI
1 parent c40cf26 commit cb8302c

File tree

5 files changed

+25
-15
lines changed

5 files changed

+25
-15
lines changed

appveyor.yml renamed to .appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
build: false
2-
clone_depth: 1
2+
clone_depth: 2
33
clone_folder: c:\projects\symfony
44

55
cache:

.github/build-packages.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@
66
}
77
chdir(dirname(__DIR__));
88

9+
$json = ltrim(file_get_contents('composer.json'));
10+
if ($json !== $package = preg_replace('/\n "repositories": \[\n.*?\n \],/s', '', $json)) {
11+
file_put_contents('composer.json', $package);
12+
}
13+
914
$dirs = $_SERVER['argv'];
1015
array_shift($dirs);
11-
$mergeBase = trim(shell_exec(sprintf('git merge-base %s HEAD', array_shift($dirs))));
16+
$mergeBase = trim(shell_exec(sprintf('git merge-base "%s" HEAD', array_shift($dirs))));
1217

1318
$packages = array();
1419
$flags = \PHP_VERSION_ID >= 50400 ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE : 0;
@@ -49,7 +54,7 @@
4954

5055
$packages[$package->name][$package->version] = $package;
5156

52-
$versions = file_get_contents('https://packagist.org/p/'.$package->name.'.json');
57+
$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'));
5358
$versions = json_decode($versions)->packages->{$package->name};
5459

5560
if ($package->version === str_replace('-dev', '.x-dev', $versions->{'dev-master'}->extra->{'branch-alias'}->{'dev-master'})) {
@@ -74,8 +79,6 @@
7479
'type' => 'composer',
7580
'url' => 'file://'.str_replace(DIRECTORY_SEPARATOR, '/', dirname(__DIR__)).'/',
7681
));
77-
if (false === strpos($json, "\n \"repositories\": [\n")) {
78-
$json = rtrim(json_encode(array('repositories' => $package->repositories), $flags), "\n}").','.substr($json, 1);
79-
file_put_contents('composer.json', $json);
80-
}
82+
$json = rtrim(json_encode(array('repositories' => $package->repositories), $flags), "\n}").','.substr($json, 1);
83+
file_put_contents('composer.json', $json);
8184
}

.github/rm-invalid-lowest-lock-files.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function getContentHash(array $composerJson)
7979
continue 2;
8080
}
8181

82-
if (isset($composerJsons[$name][2]['repositories']) && !isset($lockedJson[$key]['repositories'])) {
82+
if (isset($composerJsons[$name][2]['repositories']) && !isset($lockedJson['repositories'])) {
8383
// the locked package has been patched locally but the lock references a commit,
8484
// which means the referencing package itself is not modified
8585
continue;
@@ -104,8 +104,7 @@ function getContentHash(array $composerJson)
104104
}
105105
}
106106

107-
if (!$referencedCommits || (isset($_SERVER['TRAVIS_PULL_REQUEST']) && 'false' !== $_SERVER['TRAVIS_PULL_REQUEST'])) {
108-
// cached commits cannot be stale for PRs
107+
if (!$referencedCommits) {
109108
return;
110109
}
111110

.travis.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
language: php
22

33
dist: trusty
4-
sudo: false
54

65
git:
7-
depth: 1
6+
depth: 2
87

98
addons:
109
apt_packages:
@@ -159,7 +158,7 @@ before_install:
159158
echo extension = $ext_cache >> $INI
160159
elif [[ $PHP = 7.* ]]; then
161160
tfold ext.apcu tpecl apcu-5.1.6 apcu.so $INI
162-
tfold ext.mongodb tpecl mongodb-1.5.0 mongodb.so $INI
161+
tfold ext.mongodb tpecl mongodb-1.5.2 mongodb.so $INI
163162
fi
164163
done
165164
@@ -218,10 +217,14 @@ install:
218217
fi
219218
phpenv global ${PHP/hhvm*/hhvm}
220219
if [[ $PHP = 7.* ]]; then
221-
([[ $deps ]] && cd src/Symfony/Component/HttpFoundation; composer config platform.ext-mongodb 1.5.0; composer require --dev --no-update mongodb/mongodb)
220+
([[ $deps ]] && cd src/Symfony/Component/HttpFoundation; composer config platform.ext-mongodb 1.5.2; composer require --dev --no-update mongodb/mongodb)
222221
fi
223222
tfold 'composer update' $COMPOSER_UP
224-
tfold 'phpunit install' ./phpunit install
223+
if [[ $TRAVIS_PHP_VERSION = 5.* || $TRAVIS_PHP_VERSION = hhvm* ]]; then
224+
tfold 'phpunit install' 'composer global remove symfony/flex && ./phpunit install && composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-master'
225+
else
226+
tfold 'phpunit install' ./phpunit install
227+
fi
225228
if [[ $deps = high ]]; then
226229
echo "$COMPONENTS" | parallel --gnu -j10% "tfold {} 'cd {} && $COMPOSER_UP && $PHPUNIT_X$LEGACY'"
227230
elif [[ $deps = low ]]; then

src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,4 +1509,9 @@ public function testSetDataNonEmptyArraySubmitNullMultiple()
15091509
$this->assertEquals(array(), $form->getNormData());
15101510
$this->assertSame(array(), $form->getViewData(), 'View data is always an array');
15111511
}
1512+
1513+
public function testSubmitNullUsesDefaultEmptyData($emptyData = 'empty', $expectedData = null)
1514+
{
1515+
$this->markTestIncomplete('Added in symfony/form 2.8.');
1516+
}
15121517
}

0 commit comments

Comments
 (0)