Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / symfony / console / Tests / Helper / TableTest.php
index b195e09acb8b08a853b9e44757beeba7f99306db..b6a9d3b78bd87f4c923858b18e468cd004c90078 100644 (file)
@@ -13,9 +13,9 @@ namespace Symfony\Component\Console\Tests\Helper;
 
 use PHPUnit\Framework\TestCase;
 use Symfony\Component\Console\Helper\Table;
-use Symfony\Component\Console\Helper\TableStyle;
-use Symfony\Component\Console\Helper\TableSeparator;
 use Symfony\Component\Console\Helper\TableCell;
+use Symfony\Component\Console\Helper\TableSeparator;
+use Symfony\Component\Console\Helper\TableStyle;
 use Symfony\Component\Console\Output\StreamOutput;
 
 class TableTest extends TestCase
@@ -742,7 +742,7 @@ TABLE;
         $table->render();
     }
 
-    public function testColumnWith()
+    public function testColumnWidth()
     {
         $table = new Table($output = $this->getOutputStream());
         $table
@@ -774,7 +774,7 @@ TABLE;
         $this->assertEquals($expected, $this->getOutputContent($output));
     }
 
-    public function testColumnWiths()
+    public function testColumnWidths()
     {
         $table = new Table($output = $this->getOutputStream());
         $table
@@ -824,6 +824,42 @@ TABLE;
         Table::getStyleDefinition('absent');
     }
 
+    public function testBoxedStyleWithColspan()
+    {
+        $boxed = new TableStyle();
+        $boxed
+            ->setHorizontalBorderChar('─')
+            ->setVerticalBorderChar('│')
+            ->setCrossingChar('┼')
+        ;
+
+        $table = new Table($output = $this->getOutputStream());
+        $table->setStyle($boxed);
+        $table
+            ->setHeaders(array('ISBN', 'Title', 'Author'))
+            ->setRows(array(
+                array('99921-58-10-7', 'Divine Comedy', 'Dante Alighieri'),
+                new TableSeparator(),
+                array(new TableCell('This value spans 3 columns.', array('colspan' => 3))),
+            ))
+        ;
+        $table->render();
+
+        $expected =
+            <<<TABLE
+┼───────────────┼───────────────┼─────────────────┼
+│ ISBN          │ Title         │ Author          │
+┼───────────────┼───────────────┼─────────────────┼
+│ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri │
+┼───────────────┼───────────────┼─────────────────┼
+│ This value spans 3 columns.                     │
+┼───────────────┼───────────────┼─────────────────┼
+
+TABLE;
+
+        $this->assertSame($expected, $this->getOutputContent($output));
+    }
+
     protected function getOutputStream($decorated = false)
     {
         return new StreamOutput($this->stream, StreamOutput::VERBOSITY_NORMAL, $decorated);