Merge branch '2.8' into 3.0

* 2.8:
  [BrowserKit] Bump dom-crawler minimum version requirement
  Make one call to "OutputInterface::write" method per table row
  [HttpKernel] Fix context dependent test
  [Debug] Fix context dependent test
This commit is contained in:
Fabien Potencier 2016-06-06 17:08:35 +02:00
commit 75a3a79d30
4 changed files with 14 additions and 13 deletions

View File

@ -154,7 +154,7 @@ class ControllerResolverTest extends BaseControllerResolverTest
{
return array(
array('foo', '\LogicException', '/Unable to parse the controller name "foo"\./'),
array('foo::bar', '\InvalidArgumentException', '/Class "foo" does not exist\./'),
array('oof::bar', '\InvalidArgumentException', '/Class "oof" does not exist\./'),
array('stdClass', '\LogicException', '/Unable to parse the controller name "stdClass"\./'),
array(
'Symfony\Component\HttpKernel\Tests\Controller\ControllerResolverTest::bar',

View File

@ -307,7 +307,7 @@ class Table
*/
private function renderColumnSeparator()
{
$this->output->write(sprintf($this->style->getBorderFormat(), $this->style->getVerticalBorderChar()));
return sprintf($this->style->getBorderFormat(), $this->style->getVerticalBorderChar());
}
/**
@ -324,12 +324,12 @@ class Table
return;
}
$this->renderColumnSeparator();
$rowContent = $this->renderColumnSeparator();
foreach ($this->getRowColumns($row) as $column) {
$this->renderCell($row, $column, $cellFormat);
$this->renderColumnSeparator();
$rowContent .= $this->renderCell($row, $column, $cellFormat);
$rowContent .= $this->renderColumnSeparator();
}
$this->output->writeln('');
$this->output->writeln($rowContent);
}
/**
@ -358,12 +358,13 @@ class Table
$style = $this->getColumnStyle($column);
if ($cell instanceof TableSeparator) {
$this->output->write(sprintf($style->getBorderFormat(), str_repeat($style->getHorizontalBorderChar(), $width)));
} else {
$width += Helper::strlen($cell) - Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell);
$content = sprintf($style->getCellRowContentFormat(), $cell);
$this->output->write(sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $style->getPadType())));
return sprintf($style->getBorderFormat(), str_repeat($style->getHorizontalBorderChar(), $width));
}
$width += Helper::strlen($cell) - Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell);
$content = sprintf($style->getCellRowContentFormat(), $cell);
return sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $style->getPadType()));
}
/**

View File

@ -463,7 +463,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
$handler->handleException($exception);
$this->assertInstanceOf('Symfony\Component\Debug\Exception\ClassNotFoundException', $args[0]);
$this->assertSame("Attempted to load class \"Foo\" from the global namespace.\nDid you forget a \"use\" statement?", $args[0]->getMessage());
$this->assertStringStartsWith("Attempted to load class \"Foo\" from the global namespace.\nDid you forget a \"use\" statement", $args[0]->getMessage());
}
public function testHandleFatalErrorOnHHVM()

View File

@ -128,7 +128,7 @@ class ControllerResolverTest extends \PHPUnit_Framework_TestCase
return array(
array(1, 'InvalidArgumentException', 'Unable to find controller "1".'),
array('foo', 'InvalidArgumentException', 'Unable to find controller "foo".'),
array('foo::bar', 'InvalidArgumentException', 'Class "foo" does not exist.'),
array('oof::bar', 'InvalidArgumentException', 'Class "oof" does not exist.'),
array('stdClass', 'InvalidArgumentException', 'Unable to find controller "stdClass".'),
array('Symfony\Component\HttpKernel\Tests\Controller\ControllerTest::staticsAction', 'InvalidArgumentException', 'The controller for URI "/" is not callable. Expected method "staticsAction" on class "Symfony\Component\HttpKernel\Tests\Controller\ControllerTest", did you mean "staticAction"?'),
array('Symfony\Component\HttpKernel\Tests\Controller\ControllerTest::privateAction', 'InvalidArgumentException', 'The controller for URI "/" is not callable. Method "privateAction" on class "Symfony\Component\HttpKernel\Tests\Controller\ControllerTest" should be public and non-abstract'),