public function testWillThrowAnExcpetionIfObserverIsNotAnEvent() { $command = $this->createTestInstance(array('__invoke')); $subject = new Subject(); $subject->attach($command); $this->setExpectedException('\\Exception'); $subject->notify(); }
/** * */ public function testCollectAllUpdatedSubjects() { $subject = new Subject(); $observer = new SubjectHasUpdated(); $subject->attach($observer); $this->assertNotContains($subject, $observer); $subject->notify(); $this->assertContains($subject, $observer); }