Skip to content

Commit 73a139d

Browse files
committed
Mock terminal
1 parent 1495796 commit 73a139d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/Builder/CliMenuBuilderTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,13 @@ public function testAddSubMenuUsesTextParameterAsMenuItemText() : void
536536

537537
public function testSubMenuInheritsParentsStyle() : void
538538
{
539-
$builder = new CliMenuBuilder;
539+
$terminal = self::createMock(Terminal::class);
540+
$terminal
541+
->expects($this->any())
542+
->method('getWidth')
543+
->will($this->returnValue(200));
544+
545+
$builder = new CliMenuBuilder($terminal);
540546
$menu = $builder->setBackgroundColour('green')
541547
->addSubMenu('sub-menu', 'My SubMenu')
542548
->addItem('Some Item', function () {

0 commit comments

Comments
 (0)