summaryrefslogtreecommitdiff
path: root/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/EventObjectTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/EventObjectTest.php')
-rw-r--r--vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/EventObjectTest.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/EventObjectTest.php b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/EventObjectTest.php
new file mode 100644
index 0000000..0cfe3ca
--- /dev/null
+++ b/vendor/swiftmailer/swiftmailer/tests/unit/Swift/Events/EventObjectTest.php
@@ -0,0 +1,32 @@
+<?php
+
+class Swift_Events_EventObjectTest extends \PHPUnit_Framework_TestCase
+{
+ public function testEventSourceCanBeReturnedViaGetter()
+ {
+ $source = new stdClass();
+ $evt = $this->_createEvent($source);
+ $ref = $evt->getSource();
+ $this->assertEquals($source, $ref);
+ }
+
+ public function testEventDoesNotHaveCancelledBubbleWhenNew()
+ {
+ $source = new stdClass();
+ $evt = $this->_createEvent($source);
+ $this->assertFalse($evt->bubbleCancelled());
+ }
+
+ public function testBubbleCanBeCancelledInEvent()
+ {
+ $source = new stdClass();
+ $evt = $this->_createEvent($source);
+ $evt->cancelBubble();
+ $this->assertTrue($evt->bubbleCancelled());
+ }
+
+ private function _createEvent($source)
+ {
+ return new Swift_Events_EventObject($source);
+ }
+}