12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?php
- namespace Symfony\Component\EventDispatcher\Tests;
- use PHPUnit\Framework\TestCase;
- use Symfony\Component\EventDispatcher\Event;
- use Symfony\Component\EventDispatcher\EventDispatcher;
- class EventTest extends TestCase
- {
-
- protected $event;
-
- protected $dispatcher;
-
- protected function setUp()
- {
- $this->event = new Event();
- $this->dispatcher = new EventDispatcher();
- }
-
- protected function tearDown()
- {
- $this->event = null;
- $this->dispatcher = null;
- }
- public function testIsPropagationStopped()
- {
- $this->assertFalse($this->event->isPropagationStopped());
- }
- public function testStopPropagationAndIsPropagationStopped()
- {
- $this->event->stopPropagation();
- $this->assertTrue($this->event->isPropagationStopped());
- }
-
- public function testLegacySetDispatcher()
- {
- $this->event->setDispatcher($this->dispatcher);
- $this->assertSame($this->dispatcher, $this->event->getDispatcher());
- }
-
- public function testLegacyGetDispatcher()
- {
- $this->assertNull($this->event->getDispatcher());
- }
-
- public function testLegacyGetName()
- {
- $this->assertNull($this->event->getName());
- }
-
- public function testLegacySetName()
- {
- $this->event->setName('foo');
- $this->assertEquals('foo', $this->event->getName());
- }
- }
|