Issue #3003298 by Mile23: Fix "Adding or retrieving messages prior to the container being initialized was deprecated in Drupal 8.5.0 and this functionality will be removed before Drupal 9.0.0." deprecation error

8.7.x
Alex Pott 2018-10-01 12:44:20 +01:00
parent 56554f5da5
commit 2a383d0256
No known key found for this signature in database
GPG Key ID: 31905460D4A69276
2 changed files with 8 additions and 4 deletions

View File

@ -9,13 +9,16 @@ use Drupal\KernelTests\KernelTestBase;
/**
* @group Messenger
* @group legacy
*
* @coversDefaultClass \Drupal\Core\Messenger\LegacyMessenger
*
* Note: The Symphony PHPUnit Bridge automatically treats any test class that
* starts with "Legacy" as a deprecation. To subvert that, reverse it here.
* Normally this test class would be named LegacyMessengerTest, but test classes
* starting with 'Legacy' are treated as belonging to group legacy. We want to
* explicitly use group annotation for consistency with other legacy tests.
*
* @see http://symfony.com/blog/new-in-symfony-2-7-phpunit-bridge
* @see https://www.drupal.org/node/2931598#comment-12395743
* @see https://www.drupal.org/node/2774931
*/
class MessengerLegacyTest extends KernelTestBase {
@ -42,6 +45,8 @@ class MessengerLegacyTest extends KernelTestBase {
* @covers ::addError
* @covers ::addStatus
* @covers ::addWarning
*
* @expectedDeprecation Adding or retrieving messages prior to the container being initialized was deprecated in Drupal 8.5.0 and this functionality will be removed before Drupal 9.0.0. Please report this usage at https://www.drupal.org/node/2928994.
*/
public function testMessages() {
// Save the current container for later use.

View File

@ -129,7 +129,6 @@ trait DeprecationListenerTrait {
'CommentType is deprecated in Drupal 8.4.x and will be removed before Drupal 9.0.x. Use \Drupal\node\Plugin\migrate\source\d7\NodeType instead.',
'CommentVariablePerCommentType is deprecated in Drupal 8.4.x and will be removed before Drupal 9.0.x. Use \Drupal\node\Plugin\migrate\source\d6\NodeType instead.',
'The Drupal\migrate_drupal\Plugin\migrate\source\d6\i18nVariable is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use Drupal\migrate_drupal\Plugin\migrate\source\d6\VariableTranslation',
'Adding or retrieving messages prior to the container being initialized was deprecated in Drupal 8.5.0 and this functionality will be removed before Drupal 9.0.0. Please report this usage at https://www.drupal.org/node/2928994.',
'The "serializer.normalizer.file_entity.hal" normalizer service is deprecated: it is obsolete, it only remains available for backwards compatibility.',
'The Symfony\Component\ClassLoader\ApcClassLoader class is deprecated since Symfony 3.3 and will be removed in 4.0. Use `composer install --apcu-autoloader` instead.',
// The following deprecation is not triggered by DrupalCI testing since it