public function notify()
{
/* @var $observer \SplObserver */
foreach ($this->observers as $observer) {
$observer->update($this);
}
}
public function testWillThrowAnExcpetionIfObserverIsNotAnEvent() { $command = $this->createTestInstance(array('__invoke')); $subject = new Subject(); $subject->attach($command); $this->setExpectedException('\\Exception'); $subject->notify(); }