Tests getDefinitions() and getDefinition() of Drupal\Core\Plugin\Discovery\AlterDecorator.
public function testAlterDecorator() {
// Ensure that getDefinitions() fires and changes the actual plugin definitions.
$definitions = $this->alterTestPluginManager
->getDefinitions();
foreach ($definitions as &$definition) {
$this
->assertTrue($definition['altered']);
}
// Ensure that getDefinitions() fires and changes the actual plugin definition.
$definition = $this->alterTestPluginManager
->getDefinition('user_login');
$this
->assertTrue($definition['altered_single']);
}