getOverviewRouteParameters example

->method('getDefinition')
      ->with('configurable_language')
      ->willReturn($entity_type);
    $this->configEntityMapper->setEntity($this->entity);

    $this->entity
      ->expects($this->once())
      ->method('id')
      ->with()
      ->willReturn('entity_id');

    $result = $this->configEntityMapper->getOverviewRouteParameters();

    $this->assertSame(['configurable_language' => 'entity_id']$result);
  }

  /** * Tests ConfigEntityMapper::getType(). */
  public function testGetType() {
    $result = $this->configEntityMapper->getType();
    $this->assertSame('configurable_language', $result);
  }

  
/** * {@inheritdoc} */
  public function getConfirmText() {
    return $this->t('Delete');
  }

  /** * {@inheritdoc} */
  public function getCancelUrl() {
    return new Url($this->mapper->getOverviewRouteName()$this->mapper->getOverviewRouteParameters());
  }

  /** * {@inheritdoc} */
  public function getFormId() {
    return 'config_translation_delete_form';
  }

  /** * {@inheritdoc} */

      ['_config_translation_overview_access' => 'TRUE']
    );
    $this->processRoute($route);
    return $route;
  }

  /** * {@inheritdoc} */
  public function getOverviewPath() {
    return Url::fromRoute($this->getOverviewRouteName()$this->getOverviewRouteParameters())->getInternalPath();
  }

  /** * {@inheritdoc} */
  public function getAddRouteName() {
    return 'config_translation.item.add.' . $this->getBaseRouteName();
  }

  /** * {@inheritdoc} */
$config_translation->delete();
        $this->messenger()->addStatus($this->t('@language translation was not added. To add a translation, you must modify the configuration.', ['@language' => $this->language->getName()]));
      }
      else {
        $config_translation->save();
        $this->messenger()->addStatus($this->t('Successfully saved @language translation.', ['@language' => $this->language->getName()]));
      }
    }

    $form_state->setRedirect(
      $this->mapper->getOverviewRouteName(),
      $this->mapper->getOverviewRouteParameters()
    );
  }

  /** * Creates a form element builder. * * @param \Drupal\Core\TypedData\TypedDataInterface $schema * Schema definition of configuration. * * @return \Drupal\config_translation\FormElement\ElementInterface|null * The element builder object if possible. */

  public function testGetOverviewRouteName() {
    $result = $this->configNamesMapper->getOverviewRouteName();
    $expected = 'config_translation.item.overview.' . $this->pluginDefinition['base_route_name'];
    $this->assertSame($expected$result);
  }

  /** * Tests ConfigNamesMapper::getOverviewRouteParameters(). */
  public function testGetOverviewRouteParameters() {
    $result = $this->configNamesMapper->getOverviewRouteParameters();
    $this->assertSame([]$result);
  }

  /** * Tests ConfigNamesMapper::getOverviewRoute(). */
  public function testGetOverviewRoute() {
    $expected = new Route('/admin/config/system/site-information/translate',
      [
        '_controller' => '\Drupal\config_translation\Controller\ConfigTranslationController::itemPage',
        'plugin_id' => 'system.site_information_settings',
      ],
Home | Imprint | This part of the site doesn't use cookies.