8000 Merge branch '3.1' · symfony/symfony@052c314 · GitHub
[go: up one dir, main page]

Skip to content

Commit 052c314

Browse files
committed
Merge branch '3.1'
* 3.1: [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
2 parents cd074b3 + 1e67301 commit 052c314

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerResolverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function getUndefinedControllers()
154154
{
155155
return array(
156156
array('foo', '\LogicException', '/Unable to parse the controller name "foo"\./'),
157-
array('foo::bar', '\InvalidArgumentException', '/Class "foo" does not exist\./'),
157+
array('oof::bar', '\InvalidArgumentException', '/Class "oof" does not exist\./'),
158158
array('stdClass', '\LogicException', '/Unable to parse the controller name "stdClass"\./'),
159159
array(
160160
'Symfony\Component\HttpKernel\Tests\Controller\ControllerResolverTest::bar',

src/Symfony/Component/Console/Helper/Table.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ private function renderRowSeparator()
346346
*/
347347
private function renderColumnSeparator()
348348
{
349-
$this->output->write(sprintf($this->style->getBorderFormat(), $this->style->getVerticalBorderChar()));
349+
return sprintf($this->style->getBorderFormat(), $this->style->getVerticalBorderChar());
350350
}
351351

352352
/**
@@ -363,12 +363,12 @@ private function renderRow(array $row, $cellFormat)
363363
return;
364364
}
365365

366-
$this->renderColumnSeparator();
366+
$rowContent = $this->renderColumnSeparator();
367367
foreach ($this->getRowColumns($row) as $column) {
368-
$this->renderCell($row, $column, $cellFormat);
369-
$this->renderColumnSeparator();
368+
$rowContent .= $this->renderCell($row, $column, $cellFormat);
369+
$rowContent .= $this->renderColumnSeparator();
370370
}
371-
$this->output->writeln('');
371+
$this->output->writeln($rowContent);
372372
}
373373

374374
/**
@@ -397,12 +397,13 @@ private function renderCell(array $row, $column, $cellFormat)
397397
$style = $this->getColumnStyle($column);
398398

399399
if ($cell instanceof TableSeparator) {
400-
$this->output->write(sprintf($style->getBorderFormat(), str_repeat($style->getHorizontalBorderChar(), $width)));
401-
} else {
402-
$width += Helper::strlen($cell) - Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell);
403-
$content = sprintf($style->getCellRowContentFormat(), $cell);
404-
$this->output->write(sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $style->getPadType())));
400+
return sprintf($style->getBorderFormat(), str_repeat($style->getHorizontalBorderChar(), $width));
405401
}
402+
403+
$width += Helper::strlen($cell) - Helper::strlenWithoutDecoration($this->output->getFormatter(), $cell);
404+
$content = sprintf($style->getCellRowContentFormat(), $cell);
405+
406+
return sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $style->getPadType()));
406407
}
407408

408409
/**

src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ public function testHandleErrorException()
463463
$handler->handleException($exception);
464464

465465
$this->assertInstanceOf('Symfony\Component\Debug\Exception\ClassNotFoundException', $args[0]);
466-
$this->assertSame("Attempted to load class \"Foo\" from the global namespace.\nDid you forget a \"use\" statement?", $args[0]->getMessage());
466+
$this->assertStringStartsWith("Attempted to load class \"Foo\" from the global namespace.\nDid you forget a \"use\" statement", $args[0]->getMessage());
467467
}
468468

469469
public function testHandleFatalErrorOnHHVM()

src/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function getUndefinedControllers()
128128
return array(
129129
array(1, 'InvalidArgumentException', 'Unable to find controller "1".'),
130130
array('foo', 'InvalidArgumentException', 'Unable to find controller "foo".'),
131-
array('foo::bar', 'InvalidArgumentException', 'Class "foo" does not exist.'),
131+
array('oof::bar', 'InvalidArgumentException', 'Class "oof" does not exist.'),
132132
array('stdClass', 'InvalidArgumentException', 'Unable to find controller "stdClass".'),
133133
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"?'),
134134
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'),

0 commit comments

Comments
 (0)
0