public function RngEventMetaTest::testRegistrantsMinimumDefaultValue in RNG - Events and Registrations 8
Tests minimum registrants is unlimited if there is no field value.
@covers ::getRegistrantsMinimum
File
- tests/
src/ Kernel/ RngEventMetaTest.php, line 76
Class
- RngEventMetaTest
- Tests the event meta class.
Namespace
Drupal\Tests\rng\KernelCode
public function testRegistrantsMinimumDefaultValue() {
$field = FieldConfig::loadByName('entity_test', 'entity_test', EventManagerInterface::FIELD_REGISTRATION_REGISTRANTS_MINIMUM);
$field
->setDefaultValue([
[
'value' => 666,
],
])
->save();
$event = EntityTest::create();
$event_meta = $this->eventManager
->getMeta($event);
$this
->assertSame(666, $event_meta
->getRegistrantsMinimum(), 'Minimum registrants matches bundle default value.');
}