Merge branch '2.7' into 2.8

* 2.7:
  [2.7] Fix issues found by PHPStan
  Add php_unit_dedicate_assert to PHPCS
  [Intl] Update ICU data to 60.2
  [Console] fix a bug when you are passing a default value and passing -n would ouput the index
This commit is contained in:
Nicolas Grekas 2017-12-20 11:49:53 +01:00
commit 44db4d1170
28 changed files with 47 additions and 43 deletions

View File

@ -10,6 +10,7 @@ return PhpCsFixer\Config::create()
'@Symfony:risky' => true,
'array_syntax' => array('syntax' => 'long'),
'protected_to_private' => false,
'php_unit_dedicate_assert' => array('target' => '3.5'),
))
->setRiskyAllowed(true)
->setFinder(

View File

@ -31,7 +31,6 @@ use Symfony\Component\Form\ChoiceList\View\ChoiceView;
use Symfony\Component\Form\Forms;
use Symfony\Component\Form\Tests\Extension\Core\Type\BaseTypeTest;
use Symfony\Component\Form\Tests\Extension\Core\Type\FormTypeTest;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleAssociationToIntIdEntity;
use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdNoToStringEntity;
@ -1133,10 +1132,7 @@ class EntityTypeTest extends BaseTypeTest
$repo = $this->em->getRepository(self::SINGLE_IDENT_CLASS);
$entityType = new EntityType(
$this->emRegistry,
PropertyAccess::createPropertyAccessor()
);
$entityType = new EntityType($this->emRegistry);
$entityTypeGuesser = new DoctrineOrmTypeGuesser($this->emRegistry);
@ -1196,10 +1192,7 @@ class EntityTypeTest extends BaseTypeTest
$repo = $this->em->getRepository(self::SINGLE_IDENT_CLASS);
$entityType = new EntityType(
$this->emRegistry,
PropertyAccess::createPropertyAccessor()
);
$entityType = new EntityType($this->emRegistry);
$entityTypeGuesser = new DoctrineOrmTypeGuesser($this->emRegistry);

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Bridge\Doctrine\PropertyInfo\Tests;
namespace Symfony\Bridge\Doctrine\Tests\PropertyInfo;
use Doctrine\DBAL\Types\Type as DBALType;
use Doctrine\ORM\EntityManager;

View File

@ -115,7 +115,7 @@ class CodeHelper extends Helper
{
if (is_readable($file)) {
if (extension_loaded('fileinfo')) {
$finfo = new \Finfo();
$finfo = new \finfo();
// Check if the file is an application/octet-stream (eg. Phar file) because highlight_file cannot parse these files
if ('application/octet-stream' === $finfo->file($file, FILEINFO_MIME_TYPE)) {

View File

@ -9,12 +9,13 @@
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\TwigBundle\Tests;
namespace Symfony\Bundle\TwigBundle\Tests\Functional;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\TwigBundle\Tests\TestCase;
use Symfony\Bundle\TwigBundle\TwigBundle;
class CacheWarmingTest extends TestCase

View File

@ -9,12 +9,13 @@
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\TwigBundle\Tests;
namespace Symfony\Bundle\TwigBundle\Tests\Functional;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\TwigBundle\Tests\TestCase;
use Symfony\Bundle\TwigBundle\TwigBundle;
class NoTemplatingEntryTest extends TestCase

View File

@ -12,13 +12,9 @@
namespace Symfony\Component\Config\Tests\Definition\Builder;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Config\Tests\Definition\Builder\NodeBuilder as CustomNodeBuilder;
use Symfony\Component\Config\Tests\Fixtures\Builder\NodeBuilder as CustomNodeBuilder;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
require __DIR__.'/../../Fixtures/Builder/NodeBuilder.php';
require __DIR__.'/../../Fixtures/Builder/BarNodeDefinition.php';
require __DIR__.'/../../Fixtures/Builder/VariableNodeDefinition.php';
class TreeBuilderTest extends TestCase
{
public function testUsingACustomNodeBuilder()
@ -28,11 +24,11 @@ class TreeBuilderTest extends TestCase
$nodeBuilder = $root->children();
$this->assertInstanceOf('Symfony\Component\Config\Tests\Definition\Builder\NodeBuilder', $nodeBuilder);
$this->assertInstanceOf('Symfony\Component\Config\Tests\Fixtures\Builder\NodeBuilder', $nodeBuilder);
$nodeBuilder = $nodeBuilder->arrayNode('deeper')->children();
$this->assertInstanceOf('Symfony\Component\Config\Tests\Definition\Builder\NodeBuilder', $nodeBuilder);
$this->assertInstanceOf('Symfony\Component\Config\Tests\Fixtures\Builder\NodeBuilder', $nodeBuilder);
}
public function testOverrideABuiltInNodeType()
@ -42,7 +38,7 @@ class TreeBuilderTest extends TestCase
$definition = $root->children()->variableNode('variable');
$this->assertInstanceOf('Symfony\Component\Config\Tests\Definition\Builder\VariableNodeDefinition', $definition);
$this->assertInstanceOf('Symfony\Component\Config\Tests\Fixtures\Builder\VariableNodeDefinition', $definition);
}
public function testAddANodeType()
@ -52,7 +48,7 @@ class TreeBuilderTest extends TestCase
$definition = $root->children()->barNode('variable');
$this->assertInstanceOf('Symfony\Component\Config\Tests\Definition\Builder\BarNodeDefinition', $definition);
$this->assertInstanceOf('Symfony\Component\Config\Tests\Fixtures\Builder\BarNodeDefinition', $definition);
}
public function testCreateABuiltInNodeTypeWithACustomNodeBuilder()

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\Config\Tests\Definition\Builder;
namespace Symfony\Component\Config\Tests\Fixtures\Builder;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\Config\Tests\Fixtures\BarNode;

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\Config\Tests\Definition\Builder;
namespace Symfony\Component\Config\Tests\Fixtures\Builder;
use Symfony\Component\Config\Definition\Builder\NodeBuilder as BaseNodeBuilder;

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Symfony\Component\Config\Tests\Definition\Builder;
namespace Symfony\Component\Config\Tests\Fixtures\Builder;
use Symfony\Component\Config\Definition\Builder\VariableNodeDefinition as BaseVariableNodeDefinition;

View File

@ -46,6 +46,12 @@ class QuestionHelper extends Helper
}
if (!$input->isInteractive()) {
if ($question instanceof ChoiceQuestion) {
$choices = $question->getChoices();
return $choices[$question->getDefault()];
}
return $question->getDefault();
}

View File

@ -84,6 +84,10 @@ class QuestionHelperTest extends TestCase
$question->setMultiselect(true);
$this->assertEquals(array('Superman', 'Batman'), $questionHelper->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
$question = new ChoiceQuestion('What is your favorite superhero?', $heroes, 0);
// We are supposed to get the default value since we are not in interactive mode
$this->assertEquals('Superman', $questionHelper->ask($this->createInputInterfaceMock(true), $this->createOutputInterface(), $question));
}
public function testAsk()

View File

@ -193,6 +193,7 @@ class FlattenExceptionTest extends TestCase
public function testRecursionInArguments()
{
$a = null;
$a = array('foo', array(2, &$a));
$exception = $this->createException($a);

View File

@ -914,7 +914,7 @@ class ResponseTest extends ResponseTestCase
$ianaCodesReasonPhrases = array();
$xpath = new \DomXPath($ianaHttpStatusCodes);
$xpath = new \DOMXPath($ianaHttpStatusCodes);
$xpath->registerNamespace('ns', 'http://www.iana.org/assignments');
$records = $xpath->query('//ns:record');

View File

@ -234,7 +234,7 @@ final class Intl
*/
public static function getIcuStubVersion()
{
return '60.1';
return '60.2';
}
/**

View File

@ -15,4 +15,4 @@
57 = http://source.icu-project.org/repos/icu/icu/tags/release-57-1/source
58 = http://source.icu-project.org/repos/icu/tags/release-58-2/icu4c/source
59 = http://source.icu-project.org/repos/icu/tags/release-59-1/icu4c/source
60 = http://source.icu-project.org/repos/icu/tags/release-60-1/icu4c/source
60 = http://source.icu-project.org/repos/icu/tags/release-60-2/icu4c/source

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.37.11",
"Version": "2.1.37.96",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.37.28",
"Version": "2.1.37.69",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.37.11",
"Version": "2.1.37.96",
"Names": {
"aa": "Afar",
"ab": "Abchasisch",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.37.28",
"Version": "2.1.37.69",
"Names": {
"aa": "افار",
"ab": "ابقازیان",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.37.11",
"Version": "2.1.37.96",
"Names": {
"AC": "Ascension",
"AD": "Andorra",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.37.28",
"Version": "2.1.37.69",
"Names": {
"AC": "اسینشن آئلینڈ",
"AD": "انڈورا",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.37.11",
"Version": "2.1.37.96",
"Names": {
"Afak": "Afaka",
"Aghb": "Kaukasisch-Albanisch",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.37.28",
"Version": "2.1.37.69",
"Names": {
"Arab": "عربی",
"Armn": "آرمینیائی",

View File

@ -1,7 +1,7 @@
SVN information
===============
URL: http://source.icu-project.org/repos/icu/tags/release-60-1/icu4c/source
Revision: 40662
URL: http://source.icu-project.org/repos/icu/tags/release-60-2/icu4c/source
Revision: 40727
Author: yoshito
Date: 2017-10-31T15:14:15.305164Z
Date: 2017-12-13T20:01:38.026283Z

View File

@ -1 +1 @@
60.1
60.2

View File

@ -231,7 +231,6 @@ abstract class AbstractIntlDateFormatterTest extends TestCase
array('s', 3601, '1'),
array('s', 3630, '30'),
array('s', 43200, '0'), // 12 hours
);
$dateTime = new \DateTime('@0');
@ -936,7 +935,9 @@ abstract class AbstractIntlDateFormatterTest extends TestCase
$position = null;
$formatter = $this->getDefaultDateFormatter('y');
$this->assertSame(0, $formatter->parse('1970', $position));
$this->assertNull($position);
// Since $position is not supported by the Symfony implementation, the following won't work.
// The intl implementation works this way since 60.2.
// $this->assertSame(4, $position);
}
public function testSetPattern()

View File

@ -75,7 +75,7 @@ class PhpMatcherDumperTest extends TestCase
->setMethods(array('redirect'))
->setConstructorArgs(array(new RequestContext()))
->getMock();
$matcher->expects($this->once())->method('redirect')->with('/foo%3Abar/', 'foo');
$matcher->match('/foo%3Abar');