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
This commit is contained in:
commit
5c16f40492
7
.composer-auth.json
Normal file
7
.composer-auth.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"github-oauth": {
|
||||||
|
"github.com": "PLEASE DO NOT USE THIS TOKEN IN YOUR OWN PROJECTS/FORKS",
|
||||||
|
"github.com": "This token is reserved for testing the symfony/symfony repository",
|
||||||
|
"github.com": "52270bad1071a099c8d24629f2db2b7f07db960d"
|
||||||
|
}
|
||||||
|
}
|
@ -41,6 +41,7 @@ before_install:
|
|||||||
- 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;
|
- 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;
|
||||||
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo extension = ldap.so >> $INI_FILE; fi;
|
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo extension = ldap.so >> $INI_FILE; fi;
|
||||||
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi;
|
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi;
|
||||||
|
- if [[ $TRAVIS_REPO_SLUG = symfony/symfony ]]; then cp .composer-auth.json ~/.composer/auth.json; fi;
|
||||||
- if [[ $deps != skip ]]; then composer self-update; fi;
|
- if [[ $deps != skip ]]; then composer self-update; fi;
|
||||||
- if [[ $deps != skip ]]; then ./phpunit install; fi;
|
- if [[ $deps != skip ]]; then ./phpunit install; fi;
|
||||||
- export PHPUNIT=$(readlink -f ./phpunit)
|
- export PHPUNIT=$(readlink -f ./phpunit)
|
||||||
@ -52,13 +53,13 @@ install:
|
|||||||
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then git fetch origin $SYMFONY_VERSION; git checkout -m FETCH_HEAD; fi;
|
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then git fetch origin $SYMFONY_VERSION; git checkout -m FETCH_HEAD; fi;
|
||||||
- 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;
|
- 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;
|
||||||
- export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev;
|
- export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev;
|
||||||
- if [[ ! $deps ]]; then composer --prefer-source install; else export SYMFONY_DEPRECATIONS_HELPER=weak; fi;
|
- if [[ ! $deps ]]; then composer update --prefer-dist; else export SYMFONY_DEPRECATIONS_HELPER=weak; fi;
|
||||||
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi;
|
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi;
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- if [[ ! $deps ]]; then echo "$COMPONENTS" | parallel --gnu '$PHPUNIT --exclude-group tty,benchmark,intl-data {}'; fi;
|
- if [[ ! $deps ]]; then echo "$COMPONENTS" | parallel --gnu '$PHPUNIT --exclude-group tty,benchmark,intl-data {}'; fi;
|
||||||
- if [[ ! $deps ]]; then echo -e "\\nRunning tests requiring tty"; $PHPUNIT --group tty; fi;
|
- if [[ ! $deps ]]; then echo -e "\\nRunning tests requiring tty"; $PHPUNIT --group tty; fi;
|
||||||
- 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;
|
- 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;
|
||||||
- if [[ $deps = high ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer --prefer-source update; $PHPUNIT --exclude-group tty,benchmark,intl-data'$LEGACY; fi;
|
- if [[ $deps = high ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer update --prefer-dist; $PHPUNIT --exclude-group tty,benchmark,intl-data'$LEGACY; fi;
|
||||||
- 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;
|
- 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;
|
||||||
- if [[ $deps = skip ]]; then echo This matrix line is skipped for pull requests.; fi;
|
- if [[ $deps = skip ]]; then echo This matrix line is skipped for pull requests.; fi;
|
||||||
|
@ -46,9 +46,11 @@ install:
|
|||||||
- appveyor DownloadFile https://getcomposer.org/composer.phar
|
- appveyor DownloadFile https://getcomposer.org/composer.phar
|
||||||
- copy /Y php.ini-max php.ini
|
- copy /Y php.ini-max php.ini
|
||||||
- cd c:\projects\symfony
|
- cd c:\projects\symfony
|
||||||
|
- mkdir %APPDATA%\Composer
|
||||||
|
- IF %APPVEYOR_REPO_NAME%==symfony/symfony copy /Y .composer-auth.json %APPDATA%\Composer\auth.json
|
||||||
- php phpunit install
|
- php phpunit install
|
||||||
- IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev)
|
- IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev)
|
||||||
- composer update --prefer-source --no-progress --ansi
|
- composer update --prefer-dist --no-progress --ansi
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- cd c:\projects\symfony
|
- cd c:\projects\symfony
|
||||||
|
2
phpunit
2
phpunit
@ -53,7 +53,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
|
|||||||
chdir("phpunit-$PHPUNIT_VERSION");
|
chdir("phpunit-$PHPUNIT_VERSION");
|
||||||
passthru("$COMPOSER remove --no-update symfony/yaml");
|
passthru("$COMPOSER remove --no-update symfony/yaml");
|
||||||
passthru("$COMPOSER require --dev --no-update symfony/phpunit-bridge \">=2.8@dev\"");
|
passthru("$COMPOSER require --dev --no-update symfony/phpunit-bridge \">=2.8@dev\"");
|
||||||
passthru("$COMPOSER install --prefer-source --no-progress --ansi");
|
passthru("$COMPOSER install --prefer-dist --no-progress --ansi");
|
||||||
file_put_contents('phpunit', <<<EOPHP
|
file_put_contents('phpunit', <<<EOPHP
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ namespace Symfony\Bridge\Doctrine\PropertyInfo;
|
|||||||
use Doctrine\Common\Persistence\Mapping\ClassMetadataFactory;
|
use Doctrine\Common\Persistence\Mapping\ClassMetadataFactory;
|
||||||
use Doctrine\Common\Persistence\Mapping\MappingException;
|
use Doctrine\Common\Persistence\Mapping\MappingException;
|
||||||
use Doctrine\ORM\Mapping\ClassMetadataInfo;
|
use Doctrine\ORM\Mapping\ClassMetadataInfo;
|
||||||
|
use Doctrine\ORM\Mapping\MappingException as OrmMappingException;
|
||||||
use Symfony\Component\PropertyInfo\PropertyListExtractorInterface;
|
use Symfony\Component\PropertyInfo\PropertyListExtractorInterface;
|
||||||
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
|
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
|
||||||
use Symfony\Component\PropertyInfo\Type;
|
use Symfony\Component\PropertyInfo\Type;
|
||||||
@ -44,6 +45,8 @@ class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeE
|
|||||||
$metadata = $this->classMetadataFactory->getMetadataFor($class);
|
$metadata = $this->classMetadataFactory->getMetadataFor($class);
|
||||||
} catch (MappingException $exception) {
|
} catch (MappingException $exception) {
|
||||||
return;
|
return;
|
||||||
|
} catch (OrmMappingException $exception) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return array_merge($metadata->getFieldNames(), $metadata->getAssociationNames());
|
return array_merge($metadata->getFieldNames(), $metadata->getAssociationNames());
|
||||||
@ -58,6 +61,8 @@ class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeE
|
|||||||
$metadata = $this->classMetadataFactory->getMetadataFor($class);
|
$metadata = $this->classMetadataFactory->getMetadataFor($class);
|
||||||
} catch (MappingException $exception) {
|
} catch (MappingException $exception) {
|
||||||
return;
|
return;
|
||||||
|
} catch (OrmMappingException $exception) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($metadata->hasAssociation($property)) {
|
if ($metadata->hasAssociation($property)) {
|
||||||
|
@ -81,4 +81,14 @@ class DoctrineExtractorTest extends \PHPUnit_Framework_TestCase
|
|||||||
array('notMapped', null),
|
array('notMapped', null),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testGetPropertiesCatchException()
|
||||||
|
{
|
||||||
|
$this->assertNull($this->extractor->getProperties('Not\Exist'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testGetTypesCatchException()
|
||||||
|
{
|
||||||
|
$this->assertNull($this->extractor->getTypes('Not\Exist', 'baz'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,7 @@ class ChoiceType extends AbstractType
|
|||||||
|
|
||||||
// Set by the user
|
// Set by the user
|
||||||
if (true !== $choicesAsValues) {
|
if (true !== $choicesAsValues) {
|
||||||
throw new \RuntimeException('The "choices_as_values" option should not be used. Remove it and flip the contents of the "choices" option instead.');
|
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)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@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);
|
@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);
|
||||||
|
@ -283,10 +283,12 @@ class CollectionTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
|
|||||||
'entry_type' => 'Symfony\Component\Form\Extension\Core\Type\TextType',
|
'entry_type' => 'Symfony\Component\Form\Extension\Core\Type\TextType',
|
||||||
'entry_options' => array(
|
'entry_options' => array(
|
||||||
'data' => 'bar',
|
'data' => 'bar',
|
||||||
|
'label' => false,
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->assertSame('foo', $form->createView()->vars['prototype']->vars['value']);
|
$this->assertSame('foo', $form->createView()->vars['prototype']->vars['value']);
|
||||||
|
$this->assertFalse($form->createView()->vars['prototype']->vars['label']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testPrototypeDefaultRequired()
|
public function testPrototypeDefaultRequired()
|
||||||
|
@ -1300,13 +1300,10 @@ class Process
|
|||||||
|
|
||||||
$callback = $this->callback;
|
$callback = $this->callback;
|
||||||
foreach ($result as $type => $data) {
|
foreach ($result as $type => $data) {
|
||||||
if (3 === $type) {
|
if (3 !== $type) {
|
||||||
$this->fallbackStatus['running'] = false;
|
|
||||||
if (!isset($this->fallbackStatus['signaled'])) {
|
|
||||||
$this->fallbackStatus['exitcode'] = (int) $data;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$callback($type === self::STDOUT ? self::OUT : self::ERR, $data);
|
$callback($type === self::STDOUT ? self::OUT : self::ERR, $data);
|
||||||
|
} elseif (!isset($this->fallbackStatus['signaled'])) {
|
||||||
|
$this->fallbackStatus['exitcode'] = (int) $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -193,7 +193,7 @@ class ProcessTest extends \PHPUnit_Framework_TestCase
|
|||||||
fwrite($stream, $expected);
|
fwrite($stream, $expected);
|
||||||
rewind($stream);
|
rewind($stream);
|
||||||
|
|
||||||
$p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg($code)), null, null, null, 5);
|
$p = $this->getProcess(sprintf('%s -r %s', self::$phpBin, escapeshellarg($code)));
|
||||||
$p->setInput($stream);
|
$p->setInput($stream);
|
||||||
$p->run();
|
$p->run();
|
||||||
|
|
||||||
|
@ -186,8 +186,6 @@ class PhpMatcherDumperTest extends \PHPUnit_Framework_TestCase
|
|||||||
$route1 = new Route('/route1', array(), array(), array(), 'a.example.com');
|
$route1 = new Route('/route1', array(), array(), array(), 'a.example.com');
|
||||||
$collection1->add('route1', $route1);
|
$collection1->add('route1', $route1);
|
||||||
|
|
||||||
$collection2 = new RouteCollection();
|
|
||||||
|
|
||||||
$route2 = new Route('/c2/route2', array(), array(), array(), 'a.example.com');
|
$route2 = new Route('/c2/route2', array(), array(), array(), 'a.example.com');
|
||||||
$collection1->add('route2', $route2);
|
$collection1->add('route2', $route2);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user