AggregatorPluginManagerTest.php in Drupal 8        
                          
                  
                        
  
  
  
  
File
  core/modules/aggregator/tests/src/Kernel/AggregatorPluginManagerTest.php
  
    View source  
  <?php
namespace Drupal\Tests\aggregator\Kernel;
use Drupal\KernelTests\KernelTestBase;
class AggregatorPluginManagerTest extends KernelTestBase {
  
  public static $modules = [
    'aggregator',
    'aggregator_test',
  ];
  
  public function testFetcherInfoAlter() {
    $widget_definition = \Drupal::service('plugin.manager.aggregator.fetcher')
      ->getDefinition('aggregator_test_fetcher');
    
    $this
      ->assertTrue($widget_definition['definition_altered'], "The 'aggregator_test_fetcher' plugin definition was updated in `hook_aggregator_fetcher_info_alter()`");
  }
  
  public function testParserInfoAlter() {
    $widget_definition = \Drupal::service('plugin.manager.aggregator.parser')
      ->getDefinition('aggregator_test_parser');
    
    $this
      ->assertTrue($widget_definition['definition_altered'], "The 'aggregator_test_parser' plugin definition was updated in `hook_aggregator_parser_info_alter()`");
  }
  
  public function testProcessorInfoAlter() {
    $widget_definition = \Drupal::service('plugin.manager.aggregator.processor')
      ->getDefinition('aggregator_test_processor');
    
    $this
      ->assertTrue($widget_definition['definition_altered'], "The 'aggregator_test_processor' plugin definition was updated in `hook_aggregator_processor_info_alter()`");
  }
}