8000 Merge branch '2.8' into 3.2 · symfony/symfony@5b9e75e · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b9e75e

Browse files
Merge branch '2.8' into 3.2
* 2.8: [Console] Fix too strict test [FrameworkBundle] Execute the PhpDocExtractor earlier [validator] Updated croatian translation ignore invalid cookies expires date format [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 8f913a7 + 9cf01d8 commit 5b9e75e

File tree

10 files changed

+125
-19
lines changed

10 files changed

+125
-19
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/Validator/Resources/translations/validators.hr.xlf

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,42 @@
278278
<source>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</source>
279279
<target>Ova vrijednost ne bi trebala biti {{ compared_value_type }} {{ compared_value }}.</target>
280280
</trans-unit>
281+
<trans-unit id="73">
282+
<source>The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.</source>
283+
<target>Omjer slike je prevelik ({{ ratio }}). Dozvoljeni maksimalni omjer je {{ max_ratio }}.</target>
284+
</trans-unit>
285+
<trans-unit id="74">
286+
<source>The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}.</source>
287+
<target>Omjer slike je premali ({{ ratio }}). Minimalni očekivani omjer je {{ min_ratio }}.</target>
288+
</trans-unit>
289+
<trans-unit id="75">
290+
<source>The image is square ({{ width }}x{{ height }}px). Square images are not allowed.</source>
291+
<target>Slika je kvadratnog oblika ({{ width }}x{{ height }}px). Kvadratne slike nisu dozvoljene.</target>
292+
</trans-unit>
293+
<trans-unit id="76">
294+
<source>The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed.</source>
295+
<target>Slika je orijentirana horizontalno ({{ width }}x{{ height }}px). Horizontalno orijentirane slike nisu dozvoljene.</target>
296+
</trans-unit>
297+
<trans-unit id="77">
298+
<source>The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.</source>
299+
<target>Slika je orijentirana vertikalno ({{ width }}x{{ height }}px). Vertikalno orijentirane slike nisu dozvoljene.</target>
300+
</trans-unit>
301+
<trans-unit id="78">
302+
<source>An empty file is not allowed.</source>
303+
<target>Prazna datoteka nije dozvoljena.</target>
304+
</trans-unit>
305+
<trans-unit id="79">
306+
<source>The host could not be resolved.</source>
307+
<target>Poslužitelj nije mogao biti razriješen.</target>
308+
</trans-unit>
309+
<trans-unit id="80">
310+
<source>This value does not match the expected {{ charset }} charset.</source>
311+
<target>Znakovne oznake vrijednosti ne odgovaraju očekivanom {{ charset }} skupu.</target>
312+
</trans-unit>
313+
<trans-unit id="81">
314+
<source>This is not a valid Business Identifier Code (BIC).</source>
315+
<target>Ovo nije validan poslovni identifikacijski broj (BIC).</target>
316+
</trans-unit>
281317
</body>
282318
</file>
283319
</xliff>

0 commit comments

Comments
 (0)
0