getDefinitions(); $this->assertArrayNotHasKey('sdc_theme_test:bar', $definitions); // Component in sdc_theme should be found once sdc_theme is installed. \Drupal::service('theme_installer')->install(['sdc_theme_test']); $definitions = \Drupal::service('plugin.manager.sdc')->getDefinitions(); $this->assertArrayHasKey('sdc_theme_test:bar', $definitions); // Component in sdc_theme should not be found once sdc_theme is uninstalled. \Drupal::service('theme_installer')->uninstall(['sdc_theme_test']); $definitions = \Drupal::service('plugin.manager.sdc')->getDefinitions(); $this->assertArrayNotHasKey('sdc_theme_test:bar', $definitions); } }