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

Comments

xano’s picture

Assigned: xano » Unassigned
Status: Active » Needs review
StatusFileSize
new1.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
StatusFileSize
new2.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

StatusFileSize
new844 bytes
new2.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.