You are here

class DumpListenerTest in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/Tests/EventListener/DumpListenerTest.php \Symfony\Component\HttpKernel\Tests\EventListener\DumpListenerTest

DumpListenerTest.

@author Nicolas Grekas <p@tchwork.com>

Hierarchy

  • class \Symfony\Component\HttpKernel\Tests\EventListener\DumpListenerTest extends \Symfony\Component\HttpKernel\Tests\EventListener\PHPUnit_Framework_TestCase

Expanded class hierarchy of DumpListenerTest

File

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

Namespace

Symfony\Component\HttpKernel\Tests\EventListener
View source
class DumpListenerTest extends \PHPUnit_Framework_TestCase {
  public function testSubscribedEvents() {
    $this
      ->assertSame(array(
      KernelEvents::REQUEST => array(
        'configure',
        1024,
      ),
    ), DumpListener::getSubscribedEvents());
  }
  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;
    }
  }

}

Members