Skip to content

Commit 9cf01d8

Browse files
Merge branch '2.7' into 2.8
* 2.7: [Console] Fix too strict test [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 f4693be + de1ba1c commit 9cf01d8

File tree

8 files changed

+118
-18
lines changed

8 files changed

+118
-18
lines changed

UPGRADE-3.0.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
11
UPGRADE FROM 2.x to 3.0
22
=======================
33

4+
# Table of Contents
5+
6+
- [ClassLoader](#classloader)
7+
- [Config](#config)
8+
- [Console](#console)
9+
- [DependencyInjection](#dependencyinjection)
10+
- [DoctrineBridge](#doctrinebridge)
11+
- [DomCrawler](#domcrawler)
12+
- [EventDispatcher](#eventdispatcher)
13+
- [Form](#form)
14+
- [FrameworkBundle](#frameworkbundle)
15+
- [HttpFoundation](#httpfoundation)
16+
- [HttpKernel](#httpkernel)
17+
- [Locale](#locale)
18+
- [Monolog Bridge](#monolog-bridge)
19+
- [Process](#process)
20+
- [PropertyAccess](#propertyaccess)
21+
- [Routing](#routing)
22+
- [Security](#security)
23+
- [SecurityBundle](#securitybundle)
24+
- [Serializer](#serializer)
25+
- [Swiftmailer Bridge](#swiftmailer-bridge)
26+
- [Translator](#translator)
27+
- [Twig Bridge](#twig-bridge)
28+
- [TwigBundle](#twigbundle)
29+
- [Validator](#validator)
30+
- [WebProfiler](#webprofiler)
31+
- [Yaml](#yaml)
32+
433
### ClassLoader
534

635
* The `UniversalClassLoader` class has been removed in favor of
@@ -1755,3 +1784,9 @@ UPGRADE FROM 2.x to 3.0
17551784
```php
17561785
$request->query->get('foo')['bar'];
17571786
```
1787+
### Monolog Bridge
1788+
1789+
* `Symfony\Bridge\Monolog\Logger::emerg()` was removed. Use `emergency()` which is PSR-3 compatible.
1790+
* `Symfony\Bridge\Monolog\Logger::crit()` was removed. Use `critical()` which is PSR-3 compatible.
1791+
* `Symfony\Bridge\Monolog\Logger::err()` was removed. Use `error()` which is PSR-3 compatible.
1792+
* `Symfony\Bridge\Monolog\Logger::warn()` was removed. Use `warning()` which is PSR-3 compatible.

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
@@ -560,7 +560,7 @@ private function calculateColumnsWidth($rows)
560560

561561
foreach ($row as $i => $cell) {
562562
if ($cell instanceof TableCell) {
563-
$textLength = strlen($cell);
563+
$textLength = Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell);
564564
if ($textLength > 0) {
565565
$contentColumns = str_split($cell, ceil($textLength / $cell->getColspan()));
566566
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

@@ -650,9 +679,9 @@ public function testGetStyleDefinition()
650679
Table::getStyleDefinition('absent');
651680
}
652681

653-
protected function getOutputStream()
682+
protected function getOutputStream($decorated = false)
654683
{
655-
return new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, false);
684+
return new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, $decorated);
656685
}
657686

658687
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)
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