You are here

public function DumpListenerTest::testConfigure in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-kernel/Tests/EventListener/DumpListenerTest.php \Symfony\Component\HttpKernel\Tests\EventListener\DumpListenerTest::testConfigure()

File

vendor/symfony/http-kernel/Tests/EventListener/DumpListenerTest.php, line 36

Class

DumpListenerTest
DumpListenerTest.

Namespace

Symfony\Component\HttpKernel\Tests\EventListener

Code

public function testConfigure() {
  $prevDumper = VarDumper::setHandler('var_dump');
  VarDumper::setHandler($prevDumper);
  $cloner = new MockCloner();
  $dumper = new MockDumper();
  ob_start();
  $exception = null;
  $listener = new DumpListener($cloner, $dumper);
  try {
    $listener
      ->configure();
    VarDumper::dump('foo');
    VarDumper::dump('bar');
    $this
      ->assertSame('+foo-+bar-', ob_get_clean());
  } catch (\Exception $exception) {
  }
  VarDumper::setHandler($prevDumper);
  if (null !== $exception) {
    throw $exception;
  }
}