sir_trevor-8.x-1.x-dev/tests/src/Unit/TestDoubles/EventDispatcherSpy.php

tests/src/Unit/TestDoubles/EventDispatcherSpy.php
<?php

namespace Drupal\Tests\sir_trevor\Unit\TestDoubles;

use Symfony\Component\EventDispatcher\Event;

/**
 * Class EventDispatcherSpy
 *
 * @package Drupal\Tests\sir_trevor\Unit\TestDoubles
 */
abstract class EventDispatcherSpy extends EventDispatcherMock {
  /** @var array */
  private $dispatchedEvents = [];

  /**
   * {@inheritdoc}
   */
  public function dispatch($eventName, Event $event = NULL) {
    $this->dispatchedEvents[] = $eventName;
    return parent::dispatch($eventName, $event);
  }

  /**
   * @return array
   */
  public function getDispatchedEvents() {
    return $this->dispatchedEvents;
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc