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

Skip to content

Commit 58ed076

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: Detect Mintty for color support on Windows Detect Mintty for color support on Windows Add a group for tests of the finder against the FTP server Fix license headers Forbid serializing a Crawler Fix phpdoc block of NativeSessionStorage class Added exception when setAutoInitialize is called when locked [FrameworkBundle] Advanced search templates of bundles [Security] Allow user providers to be defined in many files Use random_bytes function if it is available for random number generation
2 parents 06c14a2 + ea2bd2a commit 58ed076

File tree

35 files changed

+184
-69
lines changed

35 files changed

+184
-69
lines changed

src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
/*
44
* This file is part of the Symfony package.
5-
*
6-
* (c) Fabien Potencier <[email protected]>
7-
*
8-
* For the full copyright and license information, please view the LICENSE
9-
* file that was distributed with this source code.
10-
*/
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
1111

1212
namespace Symfony\Bridge\Doctrine\Tests\DependencyInjection\CompilerPass;
1313

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public static function register($mode = false)
133133
private static function hasColorSupport()
134134
{
135135
if ('\\' === DIRECTORY_SEPARATOR) {
136-
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI');
136+
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM');
137137
}
138138

139139
return defined('STDOUT') && function_exists('posix_isatty') && @posix_isatty(STDOUT);

src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinder.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,12 @@ private function findTemplatesInFolder($dir)
9797
*/
9898
private function findTemplatesInBundle(BundleInterface $bundle)
9999
{
100-
$templates = $this->findTemplatesInFolder($bundle->getPath().'/Resources/views');
101100
$name = $bundle->getName();
101+
$templates = array_merge(
102+
$this->findTemplatesInFolder($bundle->getPath().'/Resources/views'),
103+
$this->findTemplatesInFolder($this->rootDir.'/'.$name.'/views')
104+
);
105+
$templates = array_unique($templates);
102106

103107
foreach ($templates as $i => $template) {
104108
$templates[$i] = $template->set('bundle', $name);

src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplateFinderTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ function ($template) { return $template->getLogicalName(); },
4646
$finder->findAllTemplates()
4747
);
4848

49-
$this->assertCount(6, $templates, '->findAllTemplates() find all templates in the bundles and global folders');
49+
$this->assertCount(7, $templates, '->findAllTemplates() find all templates in the bundles and global folders');
5050
$this->assertContains('BaseBundle::base.format.engine', $templates);
5151
$this->assertContains('BaseBundle::this.is.a.template.format.engine', $templates);
5252
$this->assertContains('BaseBundle:controller:base.format.engine', $templates);
53+
$this->assertContains('BaseBundle:controller:custom.format.engine', $templates);
5354
$this->assertContains('::this.is.a.template.format.engine', $templates);
5455
$this->assertContains('::resource.format.engine', $templates);
5556
}

src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\Bundle\FrameworkBundle\Tests\Command\CacheClearCommand;
413

514
use Symfony\Bundle\FrameworkBundle\Console\Application;

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/BaseBundle/views/base.format.engine

Whitespace-only changes.

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/BaseBundle/views/controller/custom.format.engine

Whitespace-only changes.

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Fragment/bundles.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
413
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
514

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Profiler/bundles.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
413
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
514

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/bundles.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle;
413
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
514

src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@ private function addProvidersSection(ArrayNodeDefinition $rootNode)
371371
),
372372
'my_entity_provider' => array('entity' => array('class' => 'SecurityBundle:User', 'property' => 'username')),
373373
))
374-
->disallowNewKeysInSubsequentConfigs()
375374
->isRequired()
376375
->requiresAtLeastOneElement()
377376
->useAttributeAsKey('name')

src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\Bundle\SecurityBundle\Tests\DataCollector;
413

514
use Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector;

src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/bundles.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return array(
413
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
514
new Symfony\Bundle\SecurityBundle\SecurityBundle(),

src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/FirewallEntryPoint/bundles.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
return array(
413
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
514
new Symfony\Bundle\SecurityBundle\SecurityBundle(),

src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/bundles.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
use Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FormLoginBundle\FormLoginBundle;
413
use Symfony\Bundle\TwigBundle\TwigBundle;
514
use Symfony\Bundle\SecurityBundle\SecurityBundle;

src/Symfony/Component/Console/Output/StreamOutput.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ protected function doWrite($message, $newline)
8989
*
9090
* Colorization is disabled if not supported by the stream:
9191
*
92-
* - Windows without Ansicon and ConEmu
92+
* - Windows without Ansicon, ConEmu or Mintty
9393
* - non tty consoles
9494
*
9595
* @return bool true if the stream supports colorization, false otherwise
9696
*/
9797
protected function hasColorSupport()
9898
{
9999
if (DIRECTORY_SEPARATOR === '\\') {
100-
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI');
100+
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM');
101101
}
102102

103103
return function_exists('posix_isatty') && @posix_isatty($this->stream);

src/Symfony/Component/DomCrawler/Crawler.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,17 @@ public function addNode(\DOMNode $node)
325325
}
326326
}
327327

328+
// Serializing and unserializing a crawler creates DOM objects in a corrupted state. DOM elements are not properly serializable.
329+
public function unserialize($serialized)
330+
{
331+
throw new \BadMethodCallException('A Crawler cannot be serialized.');
332+
}
333+
334+
public function serialize()
335+
{
336+
throw new \BadMethodCallException('A Crawler cannot be serialized.');
337+
}
338+
328339
/**
329340
* Returns a node given its position in the node list.
330341
*

src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
/*
44
* This file is part of the Symfony package.
5-
*
6-
* (c) Fabien Potencier <[email protected]>
7-
*
8-
* For the full copyright and license information, please view the LICENSE
9-
* file that was distributed with this source code.
10-
*/
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
1111

1212
namespace Symfony\Component\Finder\Tests\Iterator;
1313

@@ -16,42 +16,36 @@
1616
class RecursiveDirectoryIteratorTest extends IteratorTestCase
1717
{
1818
/**
19-
* @dataProvider getPaths
20-
*
21-
* @param string $path
22-
* @param bool $seekable
23-
* @param array $contains
24-
* @param string $message
19+
* @group network
2520
*/
26-
public function testRewind($path, $seekable, $contains, $message = null)
21+
public function testRewindOnFtp()
2722
{
2823
try {
29-
$i = new RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS);
24+
$i = new RecursiveDirectoryIterator('ftp://ftp.mozilla.org/', \RecursiveDirectoryIterator::SKIP_DOTS);
3025
} catch (\UnexpectedValueException $e) {
31-
$this->markTestSkipped(sprintf('Unsupported stream "%s".', $path));
26+
$this->markTestSkipped('Unsupported stream "ftp".');
3227
}
3328

3429
$i->rewind();
3530

36-
$this->assertTrue(true, $message);
31+
$this->assertTrue(true);
3732
}
3833

3934
/**
40-
* @dataProvider getPaths
41-
*
42-
* @param string $path
43-
* @param bool $seekable
44-
* @param array $contains
45-
* @param string $message
35+
* @group network
4636
*/
47-
public function testSeek($path, $seekable, $contains, $message = null)
37+
public function testSeekOnFtp()
4838
{
4939
try {
50-
$i = new RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS);
40+
$i = new RecursiveDirectoryIterator('ftp://ftp.mozilla.org/', \RecursiveDirectoryIterator::SKIP_DOTS);
5141
} catch (\UnexpectedValueException $e) {
52-
$this->markTestSkipped(sprintf('Unsupported stream "%s".', $path));
42+
$this->markTestSkipped('Unsupported stream "ftp".');
5343
}
5444

45+
$contains = array(
46+
'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'README',
47+
'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'pub',
48+
);
5549
$actual = array();
5650

5751
$i->seek(0);
@@ -62,18 +56,4 @@ public function testSeek($path, $seekable, $contains, $message = null)
6256

6357
$this->assertEquals($contains, $actual);
6458
}
65-
66-
public function getPaths()
67-
{
68-
$data = array();
69-
70-
// ftp
71-
$contains = array(
72-
'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'README',
73-
'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'pub',
74-
);
75-
$data[] = array('ftp://ftp.mozilla.org/', false, $contains);
76-
77-
return $data;
78-
}
7959
}

src/Symfony/Component/Form/FormConfigBuilder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,10 @@ public function setRequestHandler(RequestHandlerInterface $requestHandler)
854854
*/
855855
public function setAutoInitialize($initialize)
856856
{
857+
if ($this->locked) {
858+
throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.');
859+
}
860+
857861
$this->autoInitialize = (bool) $initialize;
858862

859863
return $this;

src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ArrayToPartsTransformerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the Symfony package.
55
*
6-
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
6+
* (c) Fabien Potencier <[email protected]>
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.

src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/BaseDateTimeTransformerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the Symfony package.
55
*
6-
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
6+
* (c) Fabien Potencier <[email protected]>
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.

src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ValueToDuplicatesTransformerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the Symfony package.
55
*
6-
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
6+
* (c) Fabien Potencier <[email protected]>
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the Symfony package.
55
*
6-
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
6+
* (c) Fabien Potencier <[email protected]>
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.

src/Symfony/Component/Form/Tests/Extension/Validator/Type/TypeTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the Symfony package.
55
*
6-
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
6+
* (c) Fabien Potencier <[email protected]>
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.

src/Symfony/Component/Form/Tests/Extension/Validator/ValidatorTypeGuesserTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

33
/*
4-
* This file is part of the Symfony package.
5-
*
6-
* (c) Fabien Potencier <[email protected]>
7-
*
8-
* For the full copyright and license information, please view the LICENSE
9-
* file that was distributed with this source code.
10-
*/
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
1111

1212
namespace Symfony\Component\Form\Tests\Extension\Validator;
1313

src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class NativeSessionStorage implements SessionStorageInterface
6565
* ("auto_start", is not supported as it tells PHP to start a session before
6666
* PHP starts to execute user-land code. Setting during runtime has no effect).
6767
*
68-
* cache_limiter, "nocache" (use "0" to prevent headers from being sent entirely).
68+
* cache_limiter, "" (use "0" to prevent headers from being sent entirely).
6969
* cookie_domain, ""
7070
* cookie_httponly, ""
7171
* cookie_lifetime, "0"

0 commit comments

Comments
 (0)