class EnergyBelowCutoffTest in Radioactivity 4.0.x
Same name and namespace in other branches
- 8.3 tests/src/Unit/EnergyBelowCutoffTest.php \Drupal\Tests\radioactivity\Unit\EnergyBelowCutoffTest
Checks that the event "radioactivity_field_cutoff" is correctly defined.
@coversDefaultClass \Drupal\radioactivity\Event\EnergyBelowCutoffEvent @group radioactivity
@requires module rules
Hierarchy
- class \Drupal\Tests\radioactivity\Unit\EventTestBase extends \Drupal\Tests\rules\Unit\Integration\Event\EventTestBase
- class \Drupal\Tests\radioactivity\Unit\EnergyBelowCutoffTest
Expanded class hierarchy of EnergyBelowCutoffTest
File
- tests/
src/ Unit/ EnergyBelowCutoffTest.php, line 13
Namespace
Drupal\Tests\radioactivity\UnitView source
class EnergyBelowCutoffTest extends EventTestBase {
/**
* Tests the event metadata.
*/
public function testBundleCreatedEvent() {
$plugin_definition = $this->eventManager
->getDefinition('radioactivity_field_cutoff');
$this
->assertSame('Energy is below the cutoff level', (string) $plugin_definition['label']);
$event = $this->eventManager
->createInstance('radioactivity_field_cutoff');
$entity_context_definition = $event
->getContextDefinition('entity');
$this
->assertSame('entity', $entity_context_definition
->getDataType());
$this
->assertSame('Entity', $entity_context_definition
->getLabel());
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EnergyBelowCutoffTest:: |
public | function | Tests the event metadata. | |
EventTestBase:: |
protected | function |