Merge branch '2.4' into 2.5

* 2.4:
  Minor doc fix.
  Simplified the way to update PHPUnit to the latest version
  [Process] Minor README update
  [HttpFoundation] Basic auth in url is broken when using PHP CGI/FPM
  Fixed a html error "Element ul is not closed" in logger.html.twig
  [HttpFoundation] Officialize the 308 redirect RFC
  Officialize the 308 redirect RFC
  issue #10808 crawler test
  Empty select with attribute name="foo[]" bug fix
  Fixed contextually wrong translation
This commit is contained in:
Fabien Potencier 2014-06-12 12:01:04 +02:00
commit e74d37b864
10 changed files with 31 additions and 21 deletions

View File

@ -24,7 +24,7 @@ before_script:
- sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm-nightly" ]; then echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
- sudo locale-gen fr_FR.UTF-8 && sudo update-locale
- COMPOSER_ROOT_VERSION=dev-master composer --prefer-source --dev install
- wget https://phar.phpunit.de/phpunit.phar && rm `which phpunit` && sudo cp phpunit.phar /usr/local/bin/phpunit && sudo chmod +x /usr/local/bin/phpunit
- phpunit --self-update
script:
- ls -d src/Symfony/*/* | parallel --gnu --keep-order 'echo "Running {} tests"; phpunit --exclude-group tty,benchmark {};' || false

View File

@ -128,7 +128,9 @@
<li>Called from {{ call.file is defined and call.line is defined ? call.file|format_file(call.line, from) : from|raw }}</li>
{{ index == log.context.stack|length - 1 ? '</ul>' : '' }}
{% if index == log.context.stack|length - 1 %}
</ul>
{% endif %}
{% endfor %}
{% else %}
{{ log.priorityName }} - {{ log.message }}

View File

@ -146,9 +146,11 @@ class Form extends Link implements \ArrayAccess
$values = array();
foreach ($this->getValues() as $name => $value) {
$qs = http_build_query(array($name => $value), '', '&');
parse_str($qs, $expandedValue);
$varName = substr($name, 0, strlen(key($expandedValue)));
$values = array_replace_recursive($values, array($varName => current($expandedValue)));
if (!empty($qs)) {
parse_str($qs, $expandedValue);
$varName = substr($name, 0, strlen(key($expandedValue)));
$values = array_replace_recursive($values, array($varName => current($expandedValue)));
}
}
return $values;
@ -169,9 +171,11 @@ class Form extends Link implements \ArrayAccess
$values = array();
foreach ($this->getFiles() as $name => $value) {
$qs = http_build_query(array($name => $value), '', '&');
parse_str($qs, $expandedValue);
$varName = substr($name, 0, strlen(key($expandedValue)));
$values = array_replace_recursive($values, array($varName => current($expandedValue)));
if (!empty($qs)) {
parse_str($qs, $expandedValue);
$varName = substr($name, 0, strlen(key($expandedValue)));
$values = array_replace_recursive($values, array($varName => current($expandedValue)));
}
}
return $values;

View File

@ -394,8 +394,8 @@ class FormTest extends \PHPUnit_Framework_TestCase
public function testGetValues()
{
$form = $this->createForm('<form><input type="text" name="foo[bar]" value="foo" /><input type="text" name="bar" value="bar" /><input type="submit" /></form>');
$this->assertEquals(array('foo[bar]' => 'foo', 'bar' => 'bar'), $form->getValues(), '->getValues() returns all form field values');
$form = $this->createForm('<form><input type="text" name="foo[bar]" value="foo" /><input type="text" name="bar" value="bar" /><select multiple="multiple" name="baz[]"></select><input type="submit" /></form>');
$this->assertEquals(array('foo[bar]' => 'foo', 'bar' => 'bar', 'baz' => array()), $form->getValues(), '->getValues() returns all form field values');
$form = $this->createForm('<form><input type="checkbox" name="foo" value="foo" /><input type="text" name="bar" value="bar" /><input type="submit" /></form>');
$this->assertEquals(array('bar' => 'bar'), $form->getValues(), '->getValues() does not include not-checked checkboxes');
@ -431,6 +431,10 @@ class FormTest extends \PHPUnit_Framework_TestCase
$form = $this->createForm('<form><input type="text" name="fo.o[ba.r][]" value="foo" /><input type="text" name="fo.o[ba.r][ba.z]" value="bar" /><input type="submit" /></form>');
$this->assertEquals(array('fo.o' => array('ba.r' => array('foo', 'ba.z' => 'bar'))), $form->getPhpValues(), '->getPhpValues() preserves periods and spaces in names recursively');
$form = $this->createForm('<form><input type="text" name="foo[bar]" value="foo" /><input type="text" name="bar" value="bar" /><select multiple="multiple" name="baz[]"></select><input type="submit" /></form>');
$this->assertEquals(array('foo' => array('bar' => 'foo'), 'bar' => 'bar'), $form->getPhpValues(), "->getPhpValues() doesn't return empty values");
}
public function testGetFiles()

View File

@ -21,7 +21,7 @@ interface FormTypeInterface
/**
* Builds the form.
*
* This method is called for each type in the hierarchy starting form the
* This method is called for each type in the hierarchy starting from the
* top most type. Type extensions can further modify the form.
*
* @see FormTypeExtensionInterface::buildForm()
@ -34,7 +34,7 @@ interface FormTypeInterface
/**
* Builds the form view.
*
* This method is called for each type in the hierarchy starting form the
* This method is called for each type in the hierarchy starting from the
* top most type. Type extensions can further modify the view.
*
* A view of a form is built before the views of the child forms are built.
@ -52,7 +52,7 @@ interface FormTypeInterface
/**
* Finishes the form view.
*
* This method gets called for each type in the hierarchy starting form the
* This method gets called for each type in the hierarchy starting from the
* top most type. Type extensions can further modify the view.
*
* When this method is called, views of the form's children have already

View File

@ -972,7 +972,7 @@ class Request
*/
public function getUser()
{
return $this->server->get('PHP_AUTH_USER');
return $this->headers->get('PHP_AUTH_USER');
}
/**
@ -982,7 +982,7 @@ class Request
*/
public function getPassword()
{
return $this->server->get('PHP_AUTH_PW');
return $this->headers->get('PHP_AUTH_PW');
}
/**

View File

@ -41,7 +41,7 @@ class Response
const HTTP_USE_PROXY = 305;
const HTTP_RESERVED = 306;
const HTTP_TEMPORARY_REDIRECT = 307;
const HTTP_PERMANENTLY_REDIRECT = 308; // RFC-reschke-http-status-308-07
const HTTP_PERMANENTLY_REDIRECT = 308; // RFC7238
const HTTP_BAD_REQUEST = 400;
const HTTP_UNAUTHORIZED = 401;
const HTTP_PAYMENT_REQUIRED = 402;
@ -144,7 +144,7 @@ class Response
305 => 'Use Proxy',
306 => 'Reserved',
307 => 'Temporary Redirect',
308 => 'Permanent Redirect', // RFC-reschke-http-status-308-07
308 => 'Permanent Redirect', // RFC7238
400 => 'Bad Request',
401 => 'Unauthorized',
402 => 'Payment Required',

View File

@ -209,7 +209,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(80, $request->getPort());
$this->assertEquals('test.com', $request->getHttpHost());
$this->assertEquals('testnopass', $request->getUser());
$this->assertNull($request->getPassword());
$this->assertSame('',$request->getPassword());
$this->assertFalse($request->isSecure());
$request = Request::create('http://test.com/?foo');

View File

@ -27,7 +27,7 @@ as it becomes available:
$process = new Process('ls -lsa');
$process->run(function ($type, $buffer) {
if ('err' === $type) {
if (Process::ERR === $type) {
echo 'ERR > '.$buffer;
} else {
echo 'OUT > '.$buffer;
@ -42,6 +42,6 @@ Resources
You can run the unit tests with the following command:
$ cd path/to/Symfony/Component/XXX/
$ cd path/to/Symfony/Component/Process/
$ composer.phar install
$ phpunit

View File

@ -88,7 +88,7 @@
</trans-unit>
<trans-unit id="22">
<source>This value should not be blank.</source>
<target>Bu değer boşluk olamaz.</target>
<target>Bu değer boş bırakılmamalıdır.</target>
</trans-unit>
<trans-unit id="23">
<source>This value should not be null.</source>