class LocaleGetPluralDeprecationTest

Same name and namespace in other branches
  1. main core/modules/locale/tests/src/Kernel/LocaleGetPluralDeprecationTest.php \Drupal\Tests\locale\Kernel\LocaleGetPluralDeprecationTest

Tests deprecation of locale_get_plural().

Attributes

#[CoversFunction('locale_get_plural')] #[Group('locale')] #[IgnoreDeprecations] #[RunTestsInSeparateProcesses]

Hierarchy

Expanded class hierarchy of LocaleGetPluralDeprecationTest

File

core/modules/locale/tests/src/Kernel/LocaleGetPluralDeprecationTest.php, line 16

Namespace

Drupal\Tests\locale\Kernel
View source
class LocaleGetPluralDeprecationTest extends KernelTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'locale',
  ];
  
  /**
   * Tests deprecation of locale_get_plural().
   */
  public function testLocaleGetPlural() : void {
    $this->expectUserDeprecationMessage('locale_get_plural() is deprecated in drupal:11.5.0 and is removed from drupal:13.0.0. There is no replacement. See https://www.drupal.org/node/3590542');
    // English has no imported translation, so the default formula is used.
    $this->assertSame(1, locale_get_plural(2));
  }

}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.