$cid =
$this->
randomMachineName();
$cache_backend =
$this->
createMock('Drupal\Core\Cache\CacheBackendInterface'
);
$cache_tags_invalidator =
$this->
createMock('Drupal\Core\Cache\CacheTagsInvalidatorInterface'
);
$cache_tags_invalidator ->
expects($this->
once()) ->
method('invalidateTags'
) ->
with(['tag'
]);
$cache_backend ->
expects($this->
never()) ->
method('deleteMultiple'
);
$this->
getContainerWithCacheTagsInvalidator($cache_tags_invalidator);
$plugin_manager =
new TestPluginManager($this->namespaces,
$this->expectedDefinitions, NULL, NULL, '\Drupal\plugin_test\Plugin\plugin_test\fruit\FruitInterface'
);
$plugin_manager->
setCacheBackend($cache_backend,
$cid,
['tag'
]);
$plugin_manager->
clearCachedDefinitions();
} /**
* Tests plugins with the proper interface.
*
* @covers ::createInstance
*/