class EventDataCollectorTest

Hierarchy

  • class \Symfony\Component\HttpKernel\Tests\DataCollector\EventDataCollectorTest extends \Symfony\Component\HttpKernel\Tests\DataCollector\PHPUnit_Framework_TestCase

Expanded class hierarchy of EventDataCollectorTest

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests/DataCollector/EventDataCollectorTest.php, line 20

Namespace

Symfony\Component\HttpKernel\Tests\DataCollector
View source
class EventDataCollectorTest extends \PHPUnit_Framework_TestCase {
  protected function setUp() {
    if (!class_exists('Symfony\\Component\\EventDispatcher\\EventDispatcher')) {
      $this
        ->markTestSkipped('The "EventDispatcher" component is not available');
    }
    if (!class_exists('Symfony\\Component\\HttpFoundation\\Request')) {
      $this
        ->markTestSkipped('The "HttpFoundation" component is not available');
    }
  }
  public function testCollect() {
    $c = new EventDataCollector();
    $c
      ->setEventDispatcher(new TestEventDispatcher());
    $c
      ->collect(new Request(), new Response());
    $this
      ->assertSame('events', $c
      ->getName());
    $this
      ->assertSame(array(
      'foo',
    ), $c
      ->getCalledListeners());
    $this
      ->assertSame(array(
      'bar',
    ), $c
      ->getNotCalledListeners());
  }

}

Members