Skip to content

Commit c695214

Browse files
authored
Merge pull request #42 from php-school/style-getter
Style getter
2 parents 8af643b + dbc399b commit c695214

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/CliMenu.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,4 +333,12 @@ public function closeThis()
333333
$this->terminal->moveCursorToTop();
334334
$this->open = false;
335335
}
336+
337+
/**
338+
* @return MenuStyle
339+
*/
340+
public function getStyle()
341+
{
342+
return $this->style;
343+
}
336344
}

test/CliMenuTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace PhpSchool\CliMenuTest;
4+
5+
use PhpSchool\CliMenu\CliMenu;
6+
use PhpSchool\CliMenu\MenuStyle;
7+
use PHPUnit_Framework_TestCase;
8+
9+
/**
10+
* @author Aydin Hassan <[email protected]>
11+
*/
12+
class CliMenuTest extends PHPUnit_Framework_TestCase
13+
{
14+
public function testGetMenuStyle()
15+
{
16+
$menu = new CliMenu('PHP School FTW', []);
17+
static::assertInstanceOf(MenuStyle::class, $menu->getStyle());
18+
19+
$style = new MenuStyle();
20+
$menu = new CliMenu('PHP School FTW', [], null, $style);
21+
static::assertSame($style, $menu->getStyle());
22+
}
23+
}

0 commit comments

Comments
 (0)