Open Journal Systems  3.3.0
vendor/symfony/event-dispatcher/Tests/EventTest.php
1 <?php
2 
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11 
13 
14 use PHPUnit\Framework\TestCase;
17 
21 class EventTest extends TestCase
22 {
26  protected $event;
27 
31  protected $dispatcher;
32 
37  protected function setUp()
38  {
39  $this->event = new Event();
40  $this->dispatcher = new EventDispatcher();
41  }
42 
47  protected function tearDown()
48  {
49  $this->event = null;
50  $this->dispatcher = null;
51  }
52 
53  public function testIsPropagationStopped()
54  {
55  $this->assertFalse($this->event->isPropagationStopped());
56  }
57 
59  {
60  $this->event->stopPropagation();
61  $this->assertTrue($this->event->isPropagationStopped());
62  }
63 
67  public function testLegacySetDispatcher()
68  {
69  $this->event->setDispatcher($this->dispatcher);
70  $this->assertSame($this->dispatcher, $this->event->getDispatcher());
71  }
72 
76  public function testLegacyGetDispatcher()
77  {
78  $this->assertNull($this->event->getDispatcher());
79  }
80 
84  public function testLegacyGetName()
85  {
86  $this->assertNull($this->event->getName());
87  }
88 
92  public function testLegacySetName()
93  {
94  $this->event->setName('foo');
95  $this->assertEquals('foo', $this->event->getName());
96  }
97 }
Symfony\Component\EventDispatcher\Tests\EventTest\testLegacySetName
testLegacySetName()
Definition: vendor/symfony/event-dispatcher/Tests/EventTest.php:98
Symfony\Component\EventDispatcher\Tests\EventTest\testLegacyGetDispatcher
testLegacyGetDispatcher()
Definition: vendor/symfony/event-dispatcher/Tests/EventTest.php:82
Symfony\Component\EventDispatcher\Tests\EventTest\testStopPropagationAndIsPropagationStopped
testStopPropagationAndIsPropagationStopped()
Definition: vendor/symfony/event-dispatcher/Tests/EventTest.php:64
Symfony\Component\EventDispatcher\Tests\EventTest\setUp
setUp()
Definition: vendor/symfony/event-dispatcher/Tests/EventTest.php:43
Symfony\Component\EventDispatcher\Tests\EventTest\tearDown
tearDown()
Definition: vendor/symfony/event-dispatcher/Tests/EventTest.php:53
Symfony\Component\EventDispatcher\Tests\EventTest\testIsPropagationStopped
testIsPropagationStopped()
Definition: vendor/symfony/event-dispatcher/Tests/EventTest.php:59
Symfony\Component\EventDispatcher\Tests\EventTest\$event
$event
Definition: lib/vendor/symfony/event-dispatcher/Tests/EventTest.php:29
Symfony\Component\EventDispatcher\Tests\EventTest\testLegacyGetName
testLegacyGetName()
Definition: vendor/symfony/event-dispatcher/Tests/EventTest.php:90
Symfony\Component\EventDispatcher\Tests
Definition: lib/vendor/symfony/event-dispatcher/Tests/AbstractEventDispatcherTest.php:12
Symfony\Component\EventDispatcher\Event
Definition: lib/vendor/symfony/event-dispatcher/Event.php:28
Symfony\Component\EventDispatcher\Tests\EventTest\testLegacySetDispatcher
testLegacySetDispatcher()
Definition: vendor/symfony/event-dispatcher/Tests/EventTest.php:73
Symfony\Component\EventDispatcher\EventDispatcher
Definition: lib/vendor/symfony/event-dispatcher/EventDispatcher.php:28
Symfony\Component\EventDispatcher\Tests\EventTest\$dispatcher
$dispatcher
Definition: lib/vendor/symfony/event-dispatcher/Tests/EventTest.php:37