summaryrefslogtreecommitdiffstats
path: root/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php
diff options
context:
space:
mode:
authorAlex Pott2018-05-01 09:15:07 (GMT)
committerAlex Pott2018-05-01 09:15:07 (GMT)
commitb84b827d42512f5add026b6c930d9087c79a4b7c (patch)
treef75bcf1a9977965dd983eb5f38d0191444575e14 /core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php
parent52fdfaa5f8d6bf6891a36ae03c2797750331014e (diff)
Issue #2935256 by Jo Fitzgerald, voleger, kim.pepper, ibustos, Yogesh Pawar, catch, jibran: Remove all usages of drupal_get_message and drupal_set_message in modules
Diffstat (limited to 'core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php')
-rw-r--r--core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php b/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php
index 56c0339..ac2d579 100644
--- a/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php
+++ b/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php
@@ -4,6 +4,7 @@ namespace Drupal\Tests\aggregator\Unit\Plugin;
use Drupal\aggregator\Form\SettingsForm;
use Drupal\Core\Form\FormState;
+use Drupal\Core\Messenger\MessengerInterface;
use Drupal\Tests\UnitTestCase;
/**
@@ -55,6 +56,10 @@ class AggregatorPluginSettingsBaseTest extends UnitTestCase {
->will($this->returnValue(['aggregator_test' => ['title' => '', 'description' => '']]));
}
+ /** @var \Drupal\Core\Messenger\MessengerInterface|\PHPUnit_Framework_MockObject_MockBuilder $messenger */
+ $messenger = $this->createMock(MessengerInterface::class);
+ $messenger->expects($this->any())->method('addMessage');
+
$this->settingsForm = new SettingsForm(
$this->configFactory,
$this->managers['fetcher'],
@@ -62,6 +67,7 @@ class AggregatorPluginSettingsBaseTest extends UnitTestCase {
$this->managers['processor'],
$this->getStringTranslationStub()
);
+ $this->settingsForm->setMessenger($messenger);
}
/**
@@ -104,11 +110,3 @@ class AggregatorPluginSettingsBaseTest extends UnitTestCase {
}
}
-
-// @todo Delete after https://www.drupal.org/node/2278383 is in.
-namespace Drupal\Core\Form;
-
-if (!function_exists('drupal_set_message')) {
- function drupal_set_message() {
- }
-}