8000 Merge branch '3.0' · symfony/symfony@5c16f40 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5c16f40

Browse files
Merge branch '3.0'
* 3.0: [Form] fix Catchable Fatal Error if choices is not an array [Process] Fix a transient test [Process] Fix potential race condition leading to transient tests [DoctrineBridge] [PropertyInfo] Catch Doctrine\ORM\Mapping\MappingException [Routing] removed unused variable in PhpMatcherDumperTest class. [travis] use github token to fetch deps from ZIP files [DependencyInjection] fixes typo in triggered deprecation notice. [Form] improve deprecation messages for the "empty_value" and "choice_list" options in the ChoiceType class. [Form] Fixed regression on Collection type add missing symfony/polyfill-php55 dependency
2 parents 586c58a + 52c4304 commit 5c16f40

File tree

11 files changed

+37
-15
lines changed

11 files changed

+37
-15
lines changed

.composer-auth.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"github-oauth": {
3+
"github.com": "PLEASE DO NOT USE THIS TOKEN IN YOUR OWN PROJECTS/FORKS",
4+
"github.com": "This token is reserved for testing the symfony/symfony repository",
5+
"github.com": "52270bad1071a099c8d24629f2db2b7f07db960d"
6+
}
7+
}

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ before_install:
4141
- if [[ $TRAVIS_PHP_VERSION = 5.* && ! $deps ]]; then (cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo extension = $(pwd)/modules/symfony_debug.so >> $INI_FILE); fi;
4242
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo extension = ldap.so >> $INI_FILE; fi;
4343
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi;
44+
- if [[ $TRAVIS_REPO_SLUG = symfony/symfony ]]; then cp .composer-auth.json ~/.composer/auth.json; fi;
4445
- if [[ $deps != skip ]]; then composer self-update; fi;
4546
- if [[ $deps != skip ]]; then ./phpunit install; fi;
4647
- export PHPUNIT=$(readlink -f ./phpunit)
@@ -52,13 +53,13 @@ install:
5253
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then git fetch origin $SYMFONY_VERSION; git checkout -m FETCH_HEAD; fi;
5354
- if [[ $deps = high && ${SYMFONY_VERSION%.*} != $(git show $(git ls-remote --heads | grep -FA1 /$SYMFONY_VERSION | tail -n 1):composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9]*' | head -n 1) ]]; then LEGACY=,legacy; fi;
5455
- export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev;
55-
- if [[ ! $deps ]]; then composer --prefer-source install; else export SYMFONY_DEPRECATIONS_HELPER=weak; fi;
56+
- if [[ ! $deps ]]; then composer update --prefer-dist; else export SYMFONY_DEPRECATIONS_HELPER=weak; fi;
5657
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi;
5758

5859
script:
5960
- if [[ ! $deps ]]; then echo "$COMPONENTS" | parallel --gnu '$PHPUNIT --exclude-group tty,benchmark,intl-data {}'; fi;
6061
- if [[ ! $deps ]]; then echo -e "\\nRunning tests requiring tty"; $PHPUNIT --group tty; fi;
6162
- if [[ ! $deps && $TRAVIS_PHP_VERSION = ${MIN_PHP%.*} ]]; then echo -e "1\\n0" | parallel --gnu --timeout 60 'echo -e "\\nPHP --enable-sigchild enhanced={}" && ENHANCE_SIGCHLD={} php-$MIN_PHP/sapi/cli/php .phpunit/phpunit-4.8/phpunit --colors=always src/Symfony/Component/Process/'; fi;
62-
- if [[ $deps = high ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer --prefer-source update; $PHPUNIT --exclude-group tty,benchmark,intl-data'$LEGACY; fi;
63-
- 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;
63+
- if [[ $deps = high ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer update --prefer-dist; $PHPUNIT --exclude-group tty,benchmark,intl-data'$LEGACY; fi;
64+
- if [[ $deps = low ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer update --prefer-dist --prefer-lowest --prefer-stable; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi;
6465
- if [[ $deps = skip ]]; then echo This matrix line is skipped for pull requests.; fi;

appveyor.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ install:
4646
- appveyor DownloadFile https://getcomposer.org/composer.phar
4747
- copy /Y php.ini-max php.ini
4848
- cd c:\projects\symfony
49+
- mkdir %APPDATA%\Composer
50+
- IF %APPVEYOR_REPO_NAME%==symfony/symfony copy /Y .composer-auth.json %APPDATA%\Composer\auth.json
4951
- php phpunit install
5052
- IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev)
51-
- composer update --prefer-source --no-progress --ansi
53+
- composer update --prefer-dist --no-progress --ansi
5254

5355
test_script:
5456
- cd c:\projects\symfony

phpunit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
5353
chdir("phpunit-$PHPUNIT_VERSION");
5454
passthru("$COMPOSER remove --no-update symfony/yaml");
5555
passthru("$COMPOSER require --dev --no-update symfony/phpunit-bridge \">=2.8@dev\"");
56-
passthru("$COMPOSER install --prefer-source --no-progress --ansi");
56+
passthru("$COMPOSER install --prefer-dist --no-progress --ansi");
5757
file_put_contents('phpunit', <<<EOPHP
5858
<?php
5959

src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Doctrine\Common\Persistence\Mapping\ClassMetadataFactory;
1515
use Doctrine\Common\Persistence\Mapping\MappingException;
1616
use Doctrine\ORM\Mapping\ClassMetadataInfo;
17+
use Doctrine\ORM\Mapping\MappingException as OrmMappingException;
1718
use Symfony\Component\PropertyInfo\PropertyListExtractorInterface;
1819
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
1920
use Symfony\Component\PropertyInfo\Type;
@@ -44,6 +45,8 @@ public function getProperties($class, array $context = array())
4445
$metadata = $this->classMetadataFactory->getMetadataFor($class);
4546
} catch (MappingException $exception) {
4647
return;
48+
} catch (OrmMappingException $exception) {
49+
return;
4750
}
4851

4952
return array_merge($metadata->getFieldNames(), $metadata->getAssociationNames());
@@ -58,6 +61,8 @@ public function getTypes($class, $property, array $context = array())
5861
$metadata = $this->classMetadataFactory->getMetadataFor($class);
5962
} catch (MappingException $exception) {
6063
return;
64+
} catch (OrmMappingException $exception) {
65+
return;
6166
}
6267

6368
if ($metadata->hasAssociation($property)) {

src/Symfony/Bridge/Doctrine/Tests/PropertyInfo/DoctrineExtractorTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,14 @@ public function typesProvider()
8181
array('notMapped', null),
8282
);
8383
}
84+
85+
public function testGetPropertiesCatchException()
86+
{
87+
$this->assertNull($this->extractor->getProperties('Not\Exist'));
88+
}
89+
90+
public function testGetTypesCatchException()
91+
{
92+
$this->assertNull($this->extractor->getTypes('Not\Exist', 'baz'));
93+
}
8494
}

src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ public function configureOptions(OptionsResolver $resolver)
261261

262262
// Set by the user
263263
if (true !== $choicesAsValues) {
264-
throw new \RuntimeException('The "choices_as_values" option should not be used. Remove it and flip the contents of the "choices" option instead.');
264+
throw new \RuntimeException(sprintf('The "choices_as_values" option of the %s should not be used. Remove it and flip the contents of the "choices" option instead.', get_class($this)));
265265
}
266266

267267
@trigger_error('The "choices_as_values" option is deprecated since version 3.1 and will be removed in 4.0. You should not use it anymore.', E_USER_DEPRECATED);

src/Symfony/Component/Form/Tests/Extension/Core/Type/CollectionTypeTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,12 @@ public function testPrototypeData()
283283
'entry_type' => 'Symfony\Component\Form\Extension\Core\Type\TextType',
284284
'entry_options' => array(
285285
'data' => 'bar',
286+
'label' => false,
286287
),
287288
));
288289

289290
$this->assertSame('foo', $form->createView()->vars['prototype']->vars['value']);
291+
$this->assertFalse($form->createView()->vars['prototype']->vars['label']);
290292
}
291293

292294
public function testPrototypeDefaultRequired()

src/Symfony/Component/Process/Proce 10000 ss.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,13 +1300,10 @@ private function readPipes($blocking, $close)
13001300

13011301
$callback = $this->callback;
13021302
foreach ($result as $type => $data) {
1303-
if (3 === $type) {
1304-
$this->fallbackStatus['running'] = false;
1305-
if (!isset($this->fallbackStatus['signaled'])) {
1306-
$this->fallbackStatus['exitcode'] = (int) $data;
1307-
}
1308-
} else {
1303+
if (3 !== $type) {
13091304
$callback($type === self::STDOUT ? self::OUT : self::ERR, $data);
1305+
} elseif (!isset($this->fallbackStatus['signaled'])) {
1306+
$this->fallbackStatus['exitcode'] = (int) $data;
13101307
}
13111308
}
13121309
}

src/Symfony/Component/Process/Tests/ProcessTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function testSetStreamAsInput($code, $size)
193193
fwrite($stream, $expected);
194194
rewind($stream);
195195

196-
$p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg($code)), null, null, null, 5);
196+
$p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg($code)));
197197
$p->setInput($stream);
198198
$p->run();
199199

src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,6 @@ public function getRouteCollections()
186186
$route1 = new Route('/route1', array(), array(), array(), 'a.example.com');
187187
$collection1->add('route1', $route1);
188188

189-
$collection2 = new RouteCollection();
190-
191189
$route2 = new Route('/c2/route2', array(), array(), array(), 'a.example.com');
192190
$collection1->add('route2', $route2);
193191

0 commit comments

Comments
 (0)
0