From a93b8e10f5954be0853eec693c13e84c4bd9e6f2 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 15 Dec 2017 11:24:35 -0800 Subject: Kanboard requires at least PHP 5.6 now --- .../console/Tests/Helper/LegacyTableHelperTest.php | 316 --------------------- 1 file changed, 316 deletions(-) delete mode 100644 vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php (limited to 'vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php') diff --git a/vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php b/vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php deleted file mode 100644 index 557dc14f..00000000 --- a/vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php +++ /dev/null @@ -1,316 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tests\Helper; - -use Symfony\Component\Console\Helper\TableHelper; -use Symfony\Component\Console\Output\StreamOutput; - -/** - * @group legacy - */ -class LegacyTableHelperTest extends \PHPUnit_Framework_TestCase -{ - protected $stream; - - protected function setUp() - { - $this->stream = fopen('php://memory', 'r+'); - } - - protected function tearDown() - { - fclose($this->stream); - $this->stream = null; - } - - /** - * @dataProvider testRenderProvider - */ - public function testRender($headers, $rows, $layout, $expected) - { - $table = new TableHelper(); - $table - ->setHeaders($headers) - ->setRows($rows) - ->setLayout($layout) - ; - $table->render($output = $this->getOutputStream()); - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - /** - * @dataProvider testRenderProvider - */ - public function testRenderAddRows($headers, $rows, $layout, $expected) - { - $table = new TableHelper(); - $table - ->setHeaders($headers) - ->addRows($rows) - ->setLayout($layout) - ; - $table->render($output = $this->getOutputStream()); - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - /** - * @dataProvider testRenderProvider - */ - public function testRenderAddRowsOneByOne($headers, $rows, $layout, $expected) - { - $table = new TableHelper(); - $table - ->setHeaders($headers) - ->setLayout($layout) - ; - foreach ($rows as $row) { - $table->addRow($row); - } - $table->render($output = $this->getOutputStream()); - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - public function testRenderProvider() - { - $books = array( - array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'), - array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'), - array('960-425-059-0', 'The Lord of the Rings', 'J. R. R. Tolkien'), - array('80-902734-1-6', 'And Then There Were None', 'Agatha Christie'), - ); - - return array( - array( - array('ISBN', 'Title', 'Author'), - $books, - TableHelper::LAYOUT_DEFAULT, -<<<'TABLE' -+---------------+--------------------------+------------------+ -| ISBN | Title | Author | -+---------------+--------------------------+------------------+ -| 99921-58-10-7 | Divine Comedy | Dante Alighieri | -| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | -| 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | -| 80-902734-1-6 | And Then There Were None | Agatha Christie | -+---------------+--------------------------+------------------+ - -TABLE - ), - array( - array('ISBN', 'Title', 'Author'), - $books, - TableHelper::LAYOUT_COMPACT, -<< array( - array('ISBN', 'Title', 'Author'), - array( - array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'), - array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'), - ), - TableHelper::LAYOUT_DEFAULT, -<<<'TABLE' -+---------------+----------------------+-----------------+ -| ISBN | Title | Author | -+---------------+----------------------+-----------------+ -| 99921-58-10-7 | Divine Comedy | Dante Alighieri | -| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | -+---------------+----------------------+-----------------+ - -TABLE - ), - 'Cell text with tags not used for Output styling' => array( - array('ISBN', 'Title', 'Author'), - array( - array('99921-58-10-700', 'Divine Com', 'Dante Alighieri'), - array('9971-5-0210-0', 'A Tale of Two Cities', 'Charles Dickens'), - ), - TableHelper::LAYOUT_DEFAULT, -<<<'TABLE' -+----------------------------------+----------------------+-----------------+ -| ISBN | Title | Author | -+----------------------------------+----------------------+-----------------+ -| 99921-58-10-700 | Divine Com | Dante Alighieri | -| 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | -+----------------------------------+----------------------+-----------------+ - -TABLE - ), - ); - } - - public function testRenderMultiByte() - { - $table = new TableHelper(); - $table - ->setHeaders(array('■■')) - ->setRows(array(array(1234))) - ->setLayout(TableHelper::LAYOUT_DEFAULT) - ; - $table->render($output = $this->getOutputStream()); - - $expected = -<<<'TABLE' -+------+ -| ■■ | -+------+ -| 1234 | -+------+ - -TABLE; - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - public function testRenderFullWidthCharacters() - { - $table = new TableHelper(); - $table - ->setHeaders(array('あいうえお')) - ->setRows(array(array(1234567890))) - ->setLayout(TableHelper::LAYOUT_DEFAULT) - ; - $table->render($output = $this->getOutputStream()); - - $expected = - <<<'TABLE' -+------------+ -| あいうえお | -+------------+ -| 1234567890 | -+------------+ - -TABLE; - - $this->assertEquals($expected, $this->getOutputContent($output)); - } - - protected function getOutputStream() - { - return new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, false); - } - - protected function getOutputContent(StreamOutput $output) - { - rewind($output->getStream()); - - return str_replace(PHP_EOL, "\n", stream_get_contents($output->getStream())); - } -} -- cgit v1.2.3