File: MockEventManagerAwareTrait.php

package info (click to toggle)
php-zend-eventmanager 3.14.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 904 kB
  • sloc: php: 3,542; xml: 696; makefile: 17
file content (31 lines) | stat: -rw-r--r-- 711 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php

declare(strict_types=1);

namespace LaminasTest\EventManager\TestAsset;

use Laminas\EventManager\EventManagerAwareTrait;

final class MockEventManagerAwareTrait
{
    use EventManagerAwareTrait;

    private string $eventIdentifier           = 'foo.bar';
    private bool $defaultEventListenersCalled = false;

    public function setEventIdentifier(string $eventIdentifier): self
    {
        $this->eventIdentifier = $eventIdentifier;
        return $this;
    }

    public function attachDefaultListeners(): void
    {
        $this->defaultEventListenersCalled = true;
    }

    public function defaultEventListenersCalled(): bool
    {
        return $this->defaultEventListenersCalled;
    }
}