X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Faggregator%2Ftests%2Fsrc%2FUnit%2FPlugin%2FAggregatorPluginSettingsBaseTest.php;h=ac2d5795c77bfb6819c8d1d4e1570551a4016082;hp=56c0339bd67327d24670ed01596dafd1d082380f;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php b/web/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php index 56c0339bd..ac2d5795c 100644 --- a/web/core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php +++ b/web/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() { - } -}