Skip to content

Commit

Permalink
fix WriterTest::test_justify with reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
lubiana committed Sep 4, 2024
1 parent 3fde60a commit c90400b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/Output/WriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ public function test_justify()
{
$w = new Writer(static::$ou);

$terminal = $this->createMock(Terminal::class);
$terminal->expects($this->once())
->method('width')
->willReturn(80);

$reflection = new \ReflectionProperty(Writer::class, 'terminal');
$reflection->setAccessible(true);
$reflection->setValue($w, $terminal);

$w->justify('PHP Version', PHP_VERSION, [
'sep' => '-',
]);
Expand Down

0 comments on commit c90400b

Please sign in to comment.