You are here

public function RngEventMetaTest::testRegistrantsMaximumNoField in RNG - Events and Registrations 8.2

Same name and namespace in other branches
  1. 8 tests/src/Kernel/RngEventMetaTest.php \Drupal\Tests\rng\Kernel\RngEventMetaTest::testRegistrantsMaximumNoField()
  2. 3.x tests/src/Kernel/RngEventMetaTest.php \Drupal\Tests\rng\Kernel\RngEventMetaTest::testRegistrantsMaximumNoField()

Tests maximum registrants is unlimited if there is no field value.

Including no default field value on the entity level.

@covers ::getRegistrantsMaximum

File

tests/src/Kernel/RngEventMetaTest.php, line 62

Class

RngEventMetaTest
Tests the event meta class.

Namespace

Drupal\Tests\rng\Kernel

Code

public function testRegistrantsMaximumNoField() {
  $field = FieldConfig::loadByName('entity_test', 'entity_test', EventManagerInterface::FIELD_REGISTRANTS_CAPACITY);
  $field
    ->delete();
  $event = EntityTest::create();
  $event_meta = $this->eventManager
    ->getMeta($event);
  $this
    ->assertSame($this->unlimited, $event_meta
    ->getRegistrantsMaximum(), 'Maximum registrants is unlimited when no field exists.');
}