/** * @test */ public function removeAttendeeFromObjectStorageHoldingAttendees() { $attendee = new \KevinDitscheid\KdCalendar\Domain\Model\Attendees(); $attendeesObjectStorageMock = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', array('detach'), array(), '', FALSE); $attendeesObjectStorageMock->expects($this->once())->method('detach')->with($this->equalTo($attendee)); $this->inject($this->subject, 'attendees', $attendeesObjectStorageMock); $this->subject->removeAttendee($attendee); }