TestTranslationManager example


  protected $controllerResolver;

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();

    $this->stringTranslation = new TestTranslationManager();
    $this->controllerResolver = $this->createMock('Drupal\Core\Controller\ControllerResolverInterface');
  }

  /** * Provides an extension object for a given module with a human name. * * @param string $module * The module machine name. * @param string $name * The module human name. * * @return \Drupal\Core\Extension\Extension * The extension object. */

  protected $translationManager;

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();

    $this->translationManager = new TestTranslationManager();
  }

  /** * Provides some test data for formatPlural() * @return array */
  public function providerTestFormatPlural() {
    return [
      [1, 'Singular', '@count plural', [][], 'Singular'],
      [2, 'Singular', '@count plural', [][], '2 plural'],
      // @todo support locale_get_plural
Home | Imprint | This part of the site doesn't use cookies.