EventTest.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\EventDispatcher\Tests;
  11. use Symfony\Component\EventDispatcher\Event;
  12. /**
  13. * Test class for Event.
  14. */
  15. class EventTest extends \PHPUnit_Framework_TestCase
  16. {
  17. /**
  18. * @var \Symfony\Component\EventDispatcher\Event
  19. */
  20. protected $event;
  21. /**
  22. * Sets up the fixture, for example, opens a network connection.
  23. * This method is called before a test is executed.
  24. */
  25. protected function setUp()
  26. {
  27. $this->event = new Event();
  28. }
  29. /**
  30. * Tears down the fixture, for example, closes a network connection.
  31. * This method is called after a test is executed.
  32. */
  33. protected function tearDown()
  34. {
  35. $this->event = null;
  36. }
  37. public function testIsPropagationStopped()
  38. {
  39. $this->assertFalse($this->event->isPropagationStopped());
  40. }
  41. public function testStopPropagationAndIsPropagationStopped()
  42. {
  43. $this->event->stopPropagation();
  44. $this->assertTrue($this->event->isPropagationStopped());
  45. }
  46. }