/** * @test */ public function setRegistrationForObjectStorageContainingRegistrationSetsRegistration() { $registration = new Registration(); $objectStorageHoldingExactlyOneRegistration = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); $objectStorageHoldingExactlyOneRegistration->attach($registration); $this->subject->setRegistration($objectStorageHoldingExactlyOneRegistration); $this->assertAttributeEquals($objectStorageHoldingExactlyOneRegistration, 'registration', $this->subject); }
/** * @test */ public function getRegistrationPossibleReturnsTrueIfMaxParticipantsSetAndWaitlistEnabled() { $startdate = new \DateTime(); $startdate->add(\DateInterval::createFromDateString('tomorrow')); $this->subject->setStartdate($startdate); $this->subject->setMaxParticipants(1); $this->subject->setEnableRegistration(true); $this->subject->setEnableWaitlist(true); $registration = new Registration(); $objectStorageHoldingExactlyOneRegistration = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage(); $objectStorageHoldingExactlyOneRegistration->attach($registration); $this->subject->setRegistration($objectStorageHoldingExactlyOneRegistration); $this->assertTrue($this->subject->getRegistrationPossible()); }
/** * @test * @return void */ public function isWaitlistRegistrationReturnsTrueIfEventFullyBookedAndNotEnoughFreePlaces() { $registrations = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', [], [], '', false); $registrations->expects($this->any())->method('count')->will($this->returnValue(11)); $event = new Event(); $event->setEnableWaitlist(true); $event->setMaxParticipants(10); $event->setRegistration($registrations); $this->assertTrue($this->subject->isWaitlistRegistration($event, 1)); }