Skip to content

Commit 8d776d0

Browse files
lubianaadhocore
authored andcommitted
fix WriterTest::test_justify with reflection
1 parent 02c1b3e commit 8d776d0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/Output/WriterTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,15 @@ public function test_justify()
122122
{
123123
$w = new Writer(static::$ou);
124124

125+
$terminal = $this->createMock(Terminal::class);
126+
$terminal->expects($this->once())
127+
->method('width')
128+
->willReturn(80);
129+
130+
$reflection = new \ReflectionProperty(Writer::class, 'terminal');
131+
$reflection->setAccessible(true);
132+
$reflection->setValue($w, $terminal);
133+
125134
$w->justify('PHP Version', PHP_VERSION, [
126135
'sep' => '-',
127136
]);

0 commit comments

Comments
 (0)