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
This commit is contained in:
commit
2fb4fb93f8
@ -1907,3 +1907,9 @@ UPGRADE FROM 2.x to 3.0
|
||||
```php
|
||||
$request->query->get('foo')['bar'];
|
||||
```
|
||||
### Monolog Bridge
|
||||
|
||||
* `Symfony\Bridge\Monolog\Logger::emerg()` was removed. Use `emergency()` which is PSR-3 compatible.
|
||||
* `Symfony\Bridge\Monolog\Logger::crit()` was removed. Use `critical()` which is PSR-3 compatible.
|
||||
* `Symfony\Bridge\Monolog\Logger::err()` was removed. Use `error()` which is PSR-3 compatible.
|
||||
* `Symfony\Bridge\Monolog\Logger::warn()` was removed. Use `warning()` which is PSR-3 compatible.
|
||||
|
@ -15,7 +15,7 @@
|
||||
<!-- Extractor -->
|
||||
<service id="property_info.reflection_extractor" class="Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor" public="false">
|
||||
<tag name="property_info.list_extractor" priority="-1000" />
|
||||
<tag name="property_info.type_extractor" priority="-1000" />
|
||||
<tag name="property_info.type_extractor" priority="-1002" />
|
||||
<tag name="property_info.access_extractor" priority="-1000" />
|
||||
</service>
|
||||
</services>
|
||||
|
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
|
||||
|
||||
use Symfony\Component\PropertyInfo\Type;
|
||||
|
||||
class PropertyInfoTest extends WebTestCase
|
||||
{
|
||||
public function testPhpDocPriority()
|
||||
{
|
||||
static::bootKernel(array('test_case' => 'Serializer'));
|
||||
$container = static::$kernel->getContainer();
|
||||
|
||||
$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'));
|
||||
}
|
||||
}
|
||||
|
||||
class Dummy
|
||||
{
|
||||
/**
|
||||
* @param int[] $codes
|
||||
*/
|
||||
public function setCodes(array $codes)
|
||||
{
|
||||
}
|
||||
}
|
@ -17,7 +17,7 @@ use Symfony\Component\Filesystem\Filesystem;
|
||||
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
|
||||
use Symfony\Bundle\TwigBundle\TwigBundle;
|
||||
|
||||
class NewCacheWamingTest extends \PHPUnit_Framework_TestCase
|
||||
class CacheWarmingTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testCacheIsProperlyWarmedWhenTemplatingIsAvailable()
|
||||
{
|
||||
|
@ -213,8 +213,6 @@ class Cookie
|
||||
if (false !== $date = date_create($dateValue, new \DateTimeZone('GMT'))) {
|
||||
return $date->format('U');
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException(sprintf('Could not parse date "%s".', $dateValue));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -88,10 +88,11 @@ class CookieTest extends \PHPUnit_Framework_TestCase
|
||||
Cookie::fromString('foo');
|
||||
}
|
||||
|
||||
public function testFromStringThrowsAnExceptionIfCookieDateIsNotValid()
|
||||
public function testFromStringIgnoresInvalidExpiresDate()
|
||||
{
|
||||
$this->setExpectedException('InvalidArgumentException');
|
||||
Cookie::fromString('foo=bar; expires=Flursday July 31st 2020, 08:49:37 GMT');
|
||||
$cookie = Cookie::fromString('foo=bar; expires=Flursday July 31st 2020, 08:49:37 GMT');
|
||||
|
||||
$this->assertFalse($cookie->isExpired());
|
||||
}
|
||||
|
||||
public function testFromStringThrowsAnExceptionIfUrlIsNotValid()
|
||||
|
@ -599,7 +599,7 @@ class Table
|
||||
|
||||
foreach ($row as $i => $cell) {
|
||||
if ($cell instanceof TableCell) {
|
||||
$textLength = strlen($cell);
|
||||
$textLength = Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell);
|
||||
if ($textLength > 0) {
|
||||
$contentColumns = str_split($cell, ceil($textLength / $cell->getColspan()));
|
||||
foreach ($contentColumns as $position => $content) {
|
||||
|
@ -16,6 +16,7 @@ use Symfony\Component\Console\Helper\HelperSet;
|
||||
use Symfony\Component\Console\Output\StreamOutput;
|
||||
use Symfony\Component\Console\Helper\ProcessHelper;
|
||||
use Symfony\Component\Process\Process;
|
||||
use Symfony\Component\Process\ProcessBuilder;
|
||||
|
||||
class ProcessHelperTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
@ -83,9 +84,9 @@ EOT;
|
||||
EOT;
|
||||
|
||||
$errorMessage = 'An error occurred';
|
||||
if ('\\' === DIRECTORY_SEPARATOR) {
|
||||
$successOutputProcessDebug = str_replace("'", '"', $successOutputProcessDebug);
|
||||
}
|
||||
$args = new ProcessBuilder(array('php', '-r', 'echo 42;'));
|
||||
$args = $args->getProcess()->getCommandLine();
|
||||
$successOutputProcessDebug = str_replace("'php' '-r' 'echo 42;'", $args, $successOutputProcessDebug);
|
||||
|
||||
return array(
|
||||
array('', 'php -r "echo 42;"', StreamOutput::VERBOSITY_VERBOSE, null),
|
||||
|
@ -35,9 +35,9 @@ class TableTest extends \PHPUnit_Framework_TestCase
|
||||
/**
|
||||
* @dataProvider testRenderProvider
|
||||
*/
|
||||
public function testRender($headers, $rows, $style, $expected)
|
||||
public function testRender($headers, $rows, $style, $expected, $decorated = false)
|
||||
{
|
||||
$table = new Table($output = $this->getOutputStream());
|
||||
$table = new Table($output = $this->getOutputStream($decorated));
|
||||
$table
|
||||
->setHeaders($headers)
|
||||
->setRows($rows)
|
||||
@ -51,9 +51,9 @@ class TableTest extends \PHPUnit_Framework_TestCase
|
||||
/**
|
||||
* @dataProvider testRenderProvider
|
||||
*/
|
||||
public function testRenderAddRows($headers, $rows, $style, $expected)
|
||||
public function testRenderAddRows($headers, $rows, $style, $expected, $decorated = false)
|
||||
{
|
||||
$table = new Table($output = $this->getOutputStream());
|
||||
$table = new Table($output = $this->getOutputStream($decorated));
|
||||
$table
|
||||
->setHeaders($headers)
|
||||
->addRows($rows)
|
||||
@ -67,9 +67,9 @@ class TableTest extends \PHPUnit_Framework_TestCase
|
||||
/**
|
||||
* @dataProvider testRenderProvider
|
||||
*/
|
||||
public function testRenderAddRowsOneByOne($headers, $rows, $style, $expected)
|
||||
public function testRenderAddRowsOneByOne($headers, $rows, $style, $expected, $decorated = false)
|
||||
{
|
||||
$table = new Table($output = $this->getOutputStream());
|
||||
$table = new Table($output = $this->getOutputStream($decorated));
|
||||
$table
|
||||
->setHeaders($headers)
|
||||
->setStyle($style)
|
||||
@ -485,6 +485,35 @@ TABLE
|
||||
|
||||
TABLE
|
||||
),
|
||||
'Coslpan and table cells with comment style' => array(
|
||||
array(
|
||||
new TableCell('<comment>Long Title</comment>', array('colspan' => 3)),
|
||||
),
|
||||
array(
|
||||
array(
|
||||
new TableCell('9971-5-0210-0', array('colspan' => 3)),
|
||||
),
|
||||
new TableSeparator(),
|
||||
array(
|
||||
'Dante Alighieri',
|
||||
'J. R. R. Tolkien',
|
||||
'J. R. R',
|
||||
),
|
||||
),
|
||||
'default',
|
||||
<<<TABLE
|
||||
+-----------------+------------------+---------+
|
||||
|\033[32m \033[39m\033[33mLong Title\033[39m\033[32m \033[39m|
|
||||
+-----------------+------------------+---------+
|
||||
| 9971-5-0210-0 |
|
||||
+-----------------+------------------+---------+
|
||||
| Dante Alighieri | J. R. R. Tolkien | J. R. R |
|
||||
+-----------------+------------------+---------+
|
||||
|
||||
TABLE
|
||||
,
|
||||
true,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -713,9 +742,9 @@ TABLE;
|
||||
Table::getStyleDefinition('absent');
|
||||
}
|
||||
|
||||
protected function getOutputStream()
|
||||
protected function getOutputStream($decorated = false)
|
||||
{
|
||||
return new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, false);
|
||||
return new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, $decorated);
|
||||
}
|
||||
|
||||
protected function getOutputContent(StreamOutput $output)
|
||||
|
@ -36,6 +36,7 @@ class SymfonyStyleTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
protected function tearDown()
|
||||
{
|
||||
putenv('COLUMNS');
|
||||
$this->command = null;
|
||||
$this->tester = null;
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ class DebugHandlersListener implements EventSubscriberInterface
|
||||
{
|
||||
$events = array(KernelEvents::REQUEST => array('configure', 2048));
|
||||
|
||||
if ('cli' === php_sapi_name() && defined('Symfony\Component\Console\ConsoleEvents::COMMAND')) {
|
||||
if ('cli' === PHP_SAPI && defined('Symfony\Component\Console\ConsoleEvents::COMMAND')) {
|
||||
$events[ConsoleEvents::COMMAND] = array('configure', 2048);
|
||||
}
|
||||
|
||||
|
@ -278,6 +278,42 @@
|
||||
<source>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</source>
|
||||
<target>Ova vrijednost ne bi trebala biti {{ compared_value_type }} {{ compared_value }}.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="73">
|
||||
<source>The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.</source>
|
||||
<target>Omjer slike je prevelik ({{ ratio }}). Dozvoljeni maksimalni omjer je {{ max_ratio }}.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="74">
|
||||
<source>The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}.</source>
|
||||
<target>Omjer slike je premali ({{ ratio }}). Minimalni očekivani omjer je {{ min_ratio }}.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="75">
|
||||
<source>The image is square ({{ width }}x{{ height }}px). Square images are not allowed.</source>
|
||||
<target>Slika je kvadratnog oblika ({{ width }}x{{ height }}px). Kvadratne slike nisu dozvoljene.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="76">
|
||||
<source>The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed.</source>
|
||||
<target>Slika je orijentirana horizontalno ({{ width }}x{{ height }}px). Horizontalno orijentirane slike nisu dozvoljene.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="77">
|
||||
<source>The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.</source>
|
||||
<target>Slika je orijentirana vertikalno ({{ width }}x{{ height }}px). Vertikalno orijentirane slike nisu dozvoljene.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="78">
|
||||
<source>An empty file is not allowed.</source>
|
||||
<target>Prazna datoteka nije dozvoljena.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="79">
|
||||
<source>The host could not be resolved.</source>
|
||||
<target>Poslužitelj nije mogao biti razriješen.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="80">
|
||||
<source>This value does not match the expected {{ charset }} charset.</source>
|
||||
<target>Znakovne oznake vrijednosti ne odgovaraju očekivanom {{ charset }} skupu.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="81">
|
||||
<source>This is not a valid Business Identifier Code (BIC).</source>
|
||||
<target>Ovo nije validan poslovni identifikacijski broj (BIC).</target>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
|
Reference in New Issue
Block a user