@@ -1294,9 +1294,9 @@ public static function renderSetTitle()
12941294 'footer ' ,
12951295 'default ' ,
12961296 <<<'TABLE'
1297- +---------------+---- Multiline
1297+ +---------------+--- Multiline
12981298header
1299- here - +------------------+
1299+ here +------------------+
13001300| ISBN | Title | Author |
13011301+---------------+--------------------------+------------------+
13021302| 99921-58-10-7 | Divine Comedy | Dante Alighieri |
@@ -2078,4 +2078,36 @@ public function testGithubIssue52101HorizontalFalse()
20782078 $ this ->getOutputContent ($ output )
20792079 );
20802080 }
2081+
2082+ public function testGithubIssue60038WidthOfCellWithEmoji ()
2083+ {
2084+ $ table = (new Table ($ output = $ this ->getOutputStream ()))
2085+ ->setHeaderTitle ('Test Title ' )
2086+ ->setHeaders (['Title ' , 'Author ' ])
2087+ ->setRows ([
2088+ ["🎭 💫 ☯ " ." Divine Comedy " , "Dante Alighieri " ],
2089+ // the snowflake (e2 9d 84 ef b8 8f) has a variant selector
2090+ ["👑 ❄️ 🗡 " ." Game of Thrones " , "George R.R. Martin " ],
2091+ // the snowflake in text style (e2 9d 84 ef b8 8e) has a variant selector
2092+ ["❄︎❄︎❄︎ snowflake in text style ❄︎❄︎❄︎ " , "" ],
2093+ ["And a very long line to show difference in previous lines " , "" ],
2094+ ])
2095+ ;
2096+ $ table ->render ();
2097+
2098+ $ this ->assertSame (<<<TABLE
2099+ +---------------------------------- Test Title -------------+--------------------+
2100+ | Title | Author |
2101+ +-----------------------------------------------------------+--------------------+
2102+ | 🎭 💫 ☯ Divine Comedy | Dante Alighieri |
2103+ | 👑 ❄️ 🗡 Game of Thrones | George R.R. Martin |
2104+ | ❄︎❄︎❄︎ snowflake in text style ❄︎❄︎❄︎ | |
2105+ | And a very long line to show difference in previous lines | |
2106+ +-----------------------------------------------------------+--------------------+
2107+
2108+ TABLE
2109+ ,
2110+ $ this ->getOutputContent ($ output )
2111+ );
2112+ }
20812113}
0 commit comments