| 123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace Test\Michel\Debug;
- use Michel\Debug\Output\VarDumperOutput\CliPrintOutput;
- use Michel\UniTester\TestCase;
- class CliPrintOutputTest extends TestCase
- {
- protected function setUp(): void
- {
- // TODO: Implement setUp() method.
- }
- protected function tearDown(): void
- {
- // TODO: Implement tearDown() method.
- }
- protected function execute(): void
- {
- $this->testPrint();
- }
- public function testPrint()
- {
- ob_start();
- $cliOutput = new CliPrintOutput(5, function ($dumped) {
- echo $dumped;
- });
- $cliOutput->print("Hello, world!");
- $output = ob_get_clean();
- $this->assertEquals('(string) "Hello, world!"'.PHP_EOL, $output);
- }
- }
|