Ejemplo n.º 1
0
 /**
  * Test registrations.
  */
 function testRegistrationAPI()
 {
     $this->assertIdentical(0, count(Registration::loadMultiple()), 'There are no registrations');
     // Test registration creation.
     $registration[0] = $this->createRegistration($this->event, $this->registration_type->id());
     $this->assertIdentical(1, count(Registration::loadMultiple()), 'There is one registration');
 }
 /**
  * Test registration type deletion.
  */
 function testRegistrationTypeAPIDelete()
 {
     // Associate event with registration type.
     $this->event->{EventManagerInterface::FIELD_REGISTRATION_TYPE}->appendItem(['target_id' => $this->registration_type->id()]);
     $this->event->save();
     $this->assertEqual(1, $this->countEventRegistrationTypeReferences($this->event->getEntityTypeId(), $this->registration_type->id()), 'One reference exists to this registration type');
     $registration[0] = $this->createRegistration($this->event, $this->registration_type->id());
     $this->registration_type->delete();
     $this->assertIdentical(0, count(Registration::loadMultiple()), 'Registrations no longer exist');
     $this->assertEqual(0, $this->countEventRegistrationTypeReferences($this->event->getEntityTypeId(), $this->registration_type->id()), 'No references from event entities to this registration type');
 }