File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 33namespace PhpSchool \PhpWorkshop \Factory ;
44
55use PhpSchool \CliMenu \Style \SelectableStyle ;
6+ use PhpSchool \Terminal \Terminal ;
67use Psr \Container \ContainerInterface ;
78use PhpSchool \CliMenu \CliMenu ;
89use PhpSchool \CliMenu \Builder \CliMenuBuilder ;
@@ -40,7 +41,7 @@ public function __invoke(ContainerInterface $c)
4041 $ workshopType = $ c ->get (WorkshopType::class);
4142 $ eventDispatcher = $ c ->get (EventDispatcher::class);
4243
43- $ builder = (new CliMenuBuilder )
44+ $ builder = (new CliMenuBuilder ( $ c -> get (Terminal::class)) )
4445 ->addLineBreak ();
4546
4647 if (null !== $ c ->get ('workshopLogo ' )) {
Original file line number Diff line number Diff line change 1515use PhpSchool \PhpWorkshop \UserState ;
1616use PhpSchool \PhpWorkshop \UserStateSerializer ;
1717use PhpSchool \PhpWorkshop \WorkshopType ;
18+ use PhpSchool \Terminal \Terminal ;
1819use PHPUnit \Framework \TestCase ;
1920
2021/**
@@ -42,6 +43,11 @@ public function testFactoryReturnsInstance() : void
4243 ->expects ($ this ->once ())
4344 ->method ('findAll ' )
4445 ->willReturn ([$ exercise ]);
46+
47+ $ terminal = $ this ->createMock (Terminal::class);
48+ $ terminal
49+ ->method ('getWidth ' )
50+ ->willReturn (70 );
4551
4652 $ services = [
4753 UserStateSerializer::class => $ userStateSerializer ,
@@ -56,6 +62,7 @@ public function testFactoryReturnsInstance() : void
5662 'workshopTitle ' => 'TITLE ' ,
5763 WorkshopType::class => WorkshopType::STANDARD (),
5864 EventDispatcher::class => $ this ->createMock (EventDispatcher::class),
65+ Terminal::class => $ terminal
5966 ];
6067
6168 $ container
You can’t perform that action at this time.
0 commit comments