public function RngEventMetaTest::testRegistrantsMaximumDefaultValue in RNG - Events and Registrations 8
Same name and namespace in other branches
- 8.2 tests/src/Kernel/RngEventMetaTest.php \Drupal\Tests\rng\Kernel\RngEventMetaTest::testRegistrantsMaximumDefaultValue()
- 3.x tests/src/Kernel/RngEventMetaTest.php \Drupal\Tests\rng\Kernel\RngEventMetaTest::testRegistrantsMaximumDefaultValue()
Tests maximum registrants is unlimited if there is no field value.
@covers ::getRegistrantsMaximum
File
- tests/src/ Kernel/ RngEventMetaTest.php, line 132 
Class
- RngEventMetaTest
- Tests the event meta class.
Namespace
Drupal\Tests\rng\KernelCode
public function testRegistrantsMaximumDefaultValue() {
  $field = FieldConfig::loadByName('entity_test', 'entity_test', EventManagerInterface::FIELD_REGISTRATION_REGISTRANTS_MAXIMUM);
  $field
    ->setDefaultValue([
    [
      'value' => 666,
    ],
  ])
    ->save();
  $event = EntityTest::create();
  $event_meta = $this->eventManager
    ->getMeta($event);
  $this
    ->assertSame(666, $event_meta
    ->getRegistrantsMaximum(), 'Maximum registrants matches bundle default value.');
}