Fix failing tests in PHPUnit 3.7.0-RC2

This commit is contained in:
mark_story 2012-09-09 21:25:53 -04:00
parent e8c1140fc8
commit d26040e3aa

View file

@ -241,11 +241,13 @@ class CakeEventManagerTest extends CakeTestCase {
$manager->attach(array($anotherListener, 'listenerFunction'), 'fake.event'); $manager->attach(array($anotherListener, 'listenerFunction'), 'fake.event');
$event = new CakeEvent('fake.event'); $event = new CakeEvent('fake.event');
$firstStep = clone $event; $listener->expects($this->at(0))
$listener->expects($this->at(0))->method('listenerFunction') ->method('listenerFunction')
->with($firstStep) ->with($event)
->will($this->returnValue('something special')); ->will($this->returnValue('something special'));
$anotherListener->expects($this->at(0))->method('listenerFunction')->with($event); $anotherListener->expects($this->at(0))
->method('listenerFunction')
->with($event);
$manager->dispatch($event); $manager->dispatch($event);
$this->assertEquals('something special', $event->result); $this->assertEquals('something special', $event->result);
} }
@ -263,11 +265,11 @@ class CakeEventManagerTest extends CakeTestCase {
$manager->attach(array($anotherListener, 'listenerFunction'), 'fake.event'); $manager->attach(array($anotherListener, 'listenerFunction'), 'fake.event');
$event = new CakeEvent('fake.event'); $event = new CakeEvent('fake.event');
$originalEvent = clone $event;
$listener->expects($this->at(0))->method('listenerFunction') $listener->expects($this->at(0))->method('listenerFunction')
->with($originalEvent) ->with($event)
->will($this->returnValue(false)); ->will($this->returnValue(false));
$anotherListener->expects($this->never())->method('listenerFunction'); $anotherListener->expects($this->never())
->method('listenerFunction');
$manager->dispatch($event); $manager->dispatch($event);
$this->assertTrue($event->isStopped()); $this->assertTrue($event->isStopped());
} }