\Drupal\Core\Plugin\ContextAwarePluginBase extends \Drupal\Component\Plugin\ContextAwarePluginBase, so it does not inherit any of \Drupal\Core\Plugin\PluginBase wrapping code.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Xano’s picture

Assigned: Xano » Unassigned
Status: Active » Needs review
FileSize
1.59 KB

Status: Needs review » Needs work

The last submitted patch, 1: drupal_2144701_1.patch, failed testing.

Xano’s picture

Status: Needs work » Needs review
FileSize
2.26 KB
Xano’s picture

Issue tags: +PHPUnit

This also allows ConditionPluginBase and child classes to be tested through PHPUnit.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

I am glad that things like this will be way better in the future.

dawehner’s picture

+++ b/core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php
@@ -54,4 +54,47 @@ public function setContextValue($name, $value) {
+      $this->translationManager = \Drupal::getContainer()->get('string_translation');

Any reason to not use \Drupal::translation?

Xano’s picture

I just copied this verbatim from \Drupal\Core\Plugin\PluginBase.

Xano’s picture

FileSize
844 bytes
2.52 KB
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.