@@ -1997,4 +1997,63 @@ public function testWithHyperlinkAndMaxWidth()
19971997
19981998 $ this ->assertSame ($ expected , $ this ->getOutputContent ($ output ));
19991999 }
2000+
2001+ public function testGithubIssue52101HorizontalTrue ()
2002+ {
2003+ $ tableStyle = (new TableStyle ())
2004+ ->setHorizontalBorderChars ('─ ' )
2005+ ->setVerticalBorderChars ('│ ' )
2006+ ->setCrossingChars ('┼ ' , '┌ ' , '┬ ' , '┐ ' , '┤ ' , '┘ ' , '┴ ' , '└ ' , '├ ' )
2007+ ;
2008+
2009+ $ table = (new Table ($ output = $ this ->getOutputStream ()))
2010+ ->setStyle ($ tableStyle )
2011+ ->setHeaderTitle ('Title ' )
2012+ ->setHeaders (['Hello ' , 'World ' ])
2013+ ->setRows ([[1 , 2 ], [3 , 4 ]])
2014+ ->setHorizontal (true )
2015+ ;
2016+ $ table ->render ();
2017+
2018+ $ this ->assertSame (<<<TABLE
2019+ ┌──── Title ┬───┐
2020+ │ Hello │ 1 │ 3 │
2021+ │ World │ 2 │ 4 │
2022+ └───────┴───┴───┘
2023+
2024+ TABLE
2025+ ,
2026+ $ this ->getOutputContent ($ output )
2027+ );
2028+ }
2029+
2030+ public function testGithubIssue52101HorizontalFalse ()
2031+ {
2032+ $ tableStyle = (new TableStyle ())
2033+ ->setHorizontalBorderChars ('─ ' )
2034+ ->setVerticalBorderChars ('│ ' )
2035+ ->setCrossingChars ('┼ ' , '┌ ' , '┬ ' , '┐ ' , '┤ ' , '┘ ' , '┴ ' , '└ ' , '├ ' )
2036+ ;
2037+
2038+ $ table = (new Table ($ output = $ this ->getOutputStream ()))
2039+ ->setStyle ($ tableStyle )
2040+ ->setHeaderTitle ('Title ' )
2041+ ->setHeaders (['Hello ' , 'World ' ])
2042+ ->setRows ([[1 , 2 ], [3 , 4 ]])
2043+ ->setHorizontal (false )
2044+ ;
2045+ $ table ->render ();
2046+
2047+ $ this ->assertSame (<<<TABLE
2048+ ┌──── Title ────┐
2049+ │ Hello │ World │
2050+ ├───────┼───────┤
2051+ │ 1 │ 2 │
2052+ │ 3 │ 4 │
2053+ └───────┴───────┘
2054+
2055+ TABLE ,
2056+ $ this ->getOutputContent ($ output )
2057+ );
2058+ }
20002059}
0 commit comments