EnergyBelowCutoffTest.php in Radioactivity 4.0.x        
                          
                  
                        
  
  
  
  
File
  tests/src/Unit/EnergyBelowCutoffTest.php
  
    View source  
  <?php
namespace Drupal\Tests\radioactivity\Unit;
class EnergyBelowCutoffTest extends EventTestBase {
  
  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());
  }
}