Skip to content

Commit 961c848

Browse files
authored
Add 1 new AsciiArt test
1 parent 2551372 commit 961c848

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/MenuItem/AsciiArtItemTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,20 @@ public function testGetRowsReturnsStaticAltItemWhenWidthIsTooSmall() : void
142142
self::assertSame(['my alt'], $item->getRows($menuStyle));
143143
}
144144

145+
public function testGetRowsDoesNotReturnsStaticAltItemWhenOnlySpacesOverflow() : void
146+
{
147+
$menuStyle = $this->createMock(MenuStyle::class);
148+
149+
$menuStyle
150+
->expects($this->any())
151+
->method('getContentWidth')
152+
->will($this->returnValue(15));
153+
154+
$item = new AsciiArtItem('NOT TOO LONG ', AsciiArtItem::POSITION_LEFT, 'my alt');
155+
156+
self::assertSame(['NOT TOO LONG'], $item->getRows($menuStyle));
157+
}
158+
145159
public function testWithRealAsciiArtCenterAligned() : void
146160
{
147161
$menuStyle = $this->createMock(MenuStyle::class);

0 commit comments

Comments
 (0)