Skip to content

Commit 2551372

Browse files
authored
setText test for StaticItem
1 parent deb95f8 commit 2551372

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/MenuItem/StaticItemTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,24 @@ public function testGetRowsWithContentWhichDoesNotFitOnOneLineIsWrapped() : void
6969
);
7070
}
7171

72+
public function testSetText() : void
73+
{
74+
$menuStyle = $this->createMock(MenuStyle::class);
75+
76+
$menuStyle
77+
->expects($this->once())
78+
->method('getContentWidth')
79+
->will($this->returnValue(10));
80+
81+
$item = new StaticItem('CONTENT');
82+
$item->setText('CONTENT 2 LINES');
83+
84+
$this->assertEquals(
85+
['CONTENT 2', 'LINES'],
86+
$item->getRows($menuStyle)
87+
);
88+
}
89+
7290
public function testHideAndShowItemExtraHasNoEffect() : void
7391
{
7492
$item = new StaticItem('CONTENT 1 LINE');

0 commit comments

Comments
 (0)