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 12namespace Symfony\Component\EventDispatcher\Tests; 13 14use PHPUnit\Framework\TestCase; 15use Symfony\Component\EventDispatcher\Event; 16 17/** 18 * Test class for Event. 19 */ 20class EventTest extends TestCase 21{ 22 /** 23 * @var \Symfony\Component\EventDispatcher\Event 24 */ 25 protected $event; 26 27 /** 28 * Sets up the fixture, for example, opens a network connection. 29 * This method is called before a test is executed. 30 */ 31 protected function setUp() 32 { 33 $this->event = new Event(); 34 } 35 36 /** 37 * Tears down the fixture, for example, closes a network connection. 38 * This method is called after a test is executed. 39 */ 40 protected function tearDown() 41 { 42 $this->event = null; 43 } 44 45 public function testIsPropagationStopped() 46 { 47 $this->assertFalse($this->event->isPropagationStopped()); 48 } 49 50 public function testStopPropagationAndIsPropagationStopped() 51 { 52 $this->event->stopPropagation(); 53 $this->assertTrue($this->event->isPropagationStopped()); 54 } 55} 56