/**
  * Test if findEventRegistrationsByEmail finds expected amount of registrations
  *
  * @test
  */
 public function findEventRegistrationsByEmailReturnsExpectedAmountOfRegistrations()
 {
     $event = $this->getMock('DERHANSEN\\SfEventMgt\\Domain\\Model\\Event', [], [], '', false);
     $event->expects($this->once())->method('getUid')->will($this->returnValue(10));
     $registrations = $this->registrationRepository->findEventRegistrationsByEmail($event, '*****@*****.**');
     $this->assertEquals(1, $registrations->count());
 }
 /**
  * Returns if the given e-mail is registered to the given event
  *
  * @param \DERHANSEN\SfEventMgt\Domain\Model\Event $event
  * @param string $email
  * @return bool
  */
 protected function emailNotUnique($event, $email)
 {
     $registrations = $this->registrationRepository->findEventRegistrationsByEmail($event, $email);
     return $registrations->count() >= 1;
 }