public function getRows(MenuStyle $style, $selected = false) { return explode("\n", rtrim(str_repeat(sprintf("%s\n", mb_substr(str_repeat($this->breakChar, $style->getContentWidth()), 0, $style->getContentWidth())), $this->lines))); }
public function testGetRowsWithMultiByteChars() { $menuStyle = $this->getMockBuilder(MenuStyle::class)->disableOriginalConstructor()->getMock(); $menuStyle->expects($this->any())->method('getContentWidth')->will($this->returnValue(5)); $item = new LineBreakItem('❅', 2); $this->assertEquals(['❅❅❅❅❅', '❅❅❅❅❅'], $item->getRows($menuStyle)); }