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