1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
<?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());
}
// -- Creation Methods
private function _createEvent($source)
{
return new Swift_Events_EventObject($source);
}
}
|