Skip to content

Commit 2fb4fb9

Browse files
Merge branch '3.2'
* 3.2: [Console] Fix too strict test [FrameworkBundle] Execute the PhpDocExtractor earlier [validator] Updated croatian translation Update DebugHandlersListener.php ignore invalid cookies expires date format [Console] SfStyleTest: Remove COLUMN env on tearDown [TwigBundle] Fix the name of the cache warming test class [Console] Fix TableCell issues with decoration Add missing pieces in the upgrade guide to 3.0
2 parents 09ec851 + 5b9e75e commit 2fb4fb9

File tree

12 files changed

+127
-20
lines changed

12 files changed

+127
-20
lines changed

UPGRADE-3.0.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,3 +1907,9 @@ UPGRADE FROM 2.x to 3.0
19071907
```php
19081908
$request->query->get('foo')['bar'];
19091909
```
1910+
### Monolog Bridge
1911+
1912+
* `Symfony\Bridge\Monolog\Logger::emerg()` was removed. Use `emergency()` which is PSR-3 compatible.
1913+
* `Symfony\Bridge\Monolog\Logger::crit()` was removed. Use `critical()` which is PSR-3 compatible.
1914+
* `Symfony\Bridge\Monolog\Logger::err()` was removed. Use `error()` which is PSR-3 compatible.
1915+
* `Symfony\Bridge\Monolog\Logger::warn()` was removed. Use `warning()` which is PSR-3 compatible.

src/Symfony/Bundle/FrameworkBundle/Resources/config/property_info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<!-- Extractor -->
1616
<service id="property_info.reflection_extractor" class="Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor" public="false">
1717
<tag name="property_info.list_extractor" priority="-1000" />
18-
<tag name="property_info.type_extractor" priority="-1000" />
18+
<tag name="property_info.type_extractor" priority="-1002" />
1919
<tag name="property_info.access_extractor" priority="-1000" />
2020
</service>
2121
</services>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
13+
14+
use Symfony\Component\PropertyInfo\Type;
15+
16+
class PropertyInfoTest extends WebTestCase
17+
{
18+
public function testPhpDocPriority()
19+
{
20+
static::bootKernel(array('test_case' => 'Serializer'));
21+
$container = static::$kernel->getContainer();
22+
23+
$this->assertEquals(array(new Type(Type::BUILTIN_TYPE_ARRAY, false, null, true, new Type(Type::BUILTIN_TYPE_INT), new Type(Type::BUILTIN_TYPE_INT))), $container->get('property_info')->getTypes(Dummy::class, 'codes'));
24+
}
25+
}
26+
27+
class Dummy
28+
{
29+
/**
30+
* @param int[] $codes
31+
*/
32+
public function setCodes(array $codes)
33+
{
34+
}
35+
}

src/Symfony/Bundle/TwigBundle/Tests/Functional/CacheWarmingTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
1818
use Symfony\Bundle\TwigBundle\TwigBundle;
1919

20-
class NewCacheWamingTest extends \PHPUnit_Framework_TestCase
20+
class CacheWarmingTest extends \PHPUnit_Framework_TestCase
2121
{
2222
public function testCacheIsProperlyWarmedWhenTemplatingIsAvailable()
2323
{

src/Symfony/Component/BrowserKit/Cookie.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,6 @@ private static function parseDate($dateValue)
213213
if (false !== $date = date_create($dateValue, new \DateTimeZone('GMT'))) {
214214
return $date->format('U');
215215
}
216-
217-
throw new \InvalidArgumentException(sprintf('Could not parse date "%s".', $dateValue));
218216
}
219217

220218
/**

src/Symfony/Component/BrowserKit/Tests/CookieTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@ public function testFromStringThrowsAnExceptionIfCookieIsNotValid()
8888
Cookie::fromString('foo');
8989
}
9090

91-
public function testFromStringThrowsAnExceptionIfCookieDateIsNotValid()
91+
public function testFromStringIgnoresInvalidExpiresDate()
9292
{
93-
$this->setExpectedException('InvalidArgumentException');
94-
Cookie::fromString('foo=bar; expires=Flursday July 31st 2020, 08:49:37 GMT');
93+
$cookie = Cookie::fromString('foo=bar; expires=Flursday July 31st 2020, 08:49:37 GMT');
94+
95+
$this->assertFalse($cookie->isExpired());
9596
}
9697

9798
public function testFromStringThrowsAnExceptionIfUrlIsNotValid()

src/Symfony/Component/Console/Helper/Table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ private function calculateColumnsWidth($rows)
599599

600600
foreach ($row as $i => $cell) {
601601
if ($cell instanceof TableCell) {
602-
$textLength = strlen($cell);
602+
$textLength = Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell);
603603
if ($textLength > 0) {
604604
$contentColumns = str_split($cell, ceil($textLength / $cell->getColspan()));
605605
foreach ($contentColumns as $position => $content) {

src/Symfony/Component/Console/Tests/Helper/ProcessHelperTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\Console\Output\StreamOutput;
1717
use Symfony\Component\Console\Helper\ProcessHelper;
1818
use Symfony\Component\Process\Process;
19+
use Symfony\Component\Process\ProcessBuilder;
1920

2021
class ProcessHelperTest extends \PHPUnit_Framework_TestCase
2122
{
@@ -83,9 +84,9 @@ public function provideCommandsAndOutput()
8384
EOT;
8485

8586
$errorMessage = 'An error occurred';
86-
if ('\\' === DIRECTORY_SEPARATOR) {
87-
$successOutputProcessDebug = str_replace("'", '"', $successOutputProcessDebug);
88-
}
87+
$args = new ProcessBuilder(array('php', '-r', 'echo 42;'));
88+
$args = $args->getProcess()->getCommandLine();
89+
$successOutputProcessDebug = str_replace("'php' '-r' 'echo 42;'", $args, $successOutputProcessDebug);
8990

9091
return array(
9192
array('', 'php -r "echo 42;"', StreamOutput::VERBOSITY_VERBOSE, null),

src/Symfony/Component/Console/Tests/Helper/TableTest.php

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ protected function tearDown()
3535
/**
3636
* @dataProvider testRenderProvider
3737
*/
38-
public function testRender($headers, $rows, $style, $expected)
38+
public function testRender($headers, $rows, $style, $expected, $decorated = false)
3939
{
40-
$table = new Table($output = $this->getOutputStream());
40+
$table = new Table($output = $this->getOutputStream($decorated));
4141
$table
4242
->setHeaders($headers)
4343
->setRows($rows)
@@ -51,9 +51,9 @@ public function testRender($headers, $rows, $style, $expected)
5151
/**
5252
* @dataProvider testRenderProvider
5353
*/
54-
public function testRenderAddRows($headers, $rows, $style, $expected)
54+
public function testRenderAddRows($headers, $rows, $style, $expected, $decorated = false)
5555
{
56-
$table = new Table($output = $this->getOutputStream());
56+
$table = new Table($output = $this->getOutputStream($decorated));
5757
$table
5858
->setHeaders($headers)
5959
->addRows($rows)
@@ -67,9 +67,9 @@ public function testRenderAddRows($headers, $rows, $style, $expected)
6767
/**
6868
* @dataProvider testRenderProvider
6969
*/
70-
public function testRenderAddRowsOneByOne($headers, $rows, $style, $expected)
70+
public function testRenderAddRowsOneByOne($headers, $rows, $style, $expected, $decorated = false)
7171
{
72-
$table = new Table($output = $this->getOutputStream());
72+
$table = new Table($output = $this->getOutputStream($decorated));
7373
$table
7474
->setHeaders($headers)
7575
->setStyle($style)
@@ -485,6 +485,35 @@ public function testRenderProvider()
485485

486486
TABLE
487487
),
488+
'Coslpan and table cells with comment style' => array(
489+
array(
490+
new TableCell('<comment>Long Title</comment>', array('colspan' => 3)),
491+
),
492+
array(
493+
array(
494+
new TableCell('9971-5-0210-0', array('colspan' => 3)),
495+
),
496+
new TableSeparator(),
497+
array(
498+
'Dante Alighieri',
499+
'J. R. R. Tolkien',
500+
'J. R. R',
501+
),
502+
),
503+
'default',
504+
<<<TABLE
505+
+-----------------+------------------+---------+
506+
|\033[32m \033[39m\033[33mLong Title\033[39m\033[32m \033[39m|
507+
+-----------------+------------------+---------+
508+
| 9971-5-0210-0 |
509+
+-----------------+------------------+---------+
510+
| Dante Alighieri | J. R. R. Tolkien | J. R. R |
511+
+-----------------+------------------+---------+
512+
513+
TABLE
514+
,
515+
true,
516+
),
488517
);
489518
}
490519

@@ -713,9 +742,9 @@ public function testGetStyleDefinition()
713742
Table::getStyleDefinition('absent');
714743
}
715744

716-
protected function getOutputStream()
745+
protected function getOutputStream($decorated = false)
717746
{
718-
return new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, false);
747+
return new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, $decorated);
719748
}
720749

721750
protected function getOutputContent(StreamOutput $output)

src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ protected function setUp()
3636

3737
protected function tearDown()
3838
{
39+
putenv('COLUMNS');
3940
$this->command = null;
4041
$this->tester = null;
4142
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy