TranslationWrapperTest.php in Drupal 9
File
core/tests/Drupal/Tests/Core/StringTranslation/TranslationWrapperTest.php
View source
<?php
namespace Drupal\Tests\Core\StringTranslation;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\StringTranslation\TranslationWrapper;
use Drupal\Tests\UnitTestCase;
class TranslationWrapperTest extends UnitTestCase {
public function testTranslationWrapper() {
$this
->expectDeprecation('Drupal\\Core\\StringTranslation\\TranslationWrapper is deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use the \\Drupal\\Core\\StringTranslation\\TranslatableMarkup class instead. See https://www.drupal.org/node/2571255');
$object = new TranslationWrapper('Deprecated');
$this
->assertInstanceOf(TranslatableMarkup::class, $object);
}
}