CliVarDumpOutputTest.php 770 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Test\Michel\Debug;
  3. use Michel\Debug\Output\VarDumperOutput\CliVarDumpOutput;
  4. use Michel\UniTester\TestCase;
  5. class CliVarDumpOutputTest extends TestCase
  6. {
  7. protected function setUp(): void
  8. {
  9. // TODO: Implement setUp() method.
  10. }
  11. protected function tearDown(): void
  12. {
  13. // TODO: Implement tearDown() method.
  14. }
  15. protected function execute(): void
  16. {
  17. $this->testVarDump();
  18. }
  19. public function testVarDump()
  20. {
  21. ob_start();
  22. $cliOutput = new CliVarDumpOutput(function ($dumped) {
  23. echo $dumped;
  24. });
  25. $cliOutput->print("Hello, world!");
  26. $output = ob_get_clean();
  27. $this->assertStringContains($output, 'string(13) "Hello, world!"');
  28. }
  29. }