getOverviewPath example



  /** * Tests ConfigNamesMapper::getOverviewPath(). */
  public function testGetOverviewPath() {
    $this->urlGenerator->expects($this->once())
      ->method('getPathFromRoute')
      ->with('config_translation.item.overview.system.site_information_settings', [])
      ->willReturn('/admin/config/system/site-information/translate');

    $result = $this->configNamesMapper->getOverviewPath();
    $this->assertSame('/admin/config/system/site-information/translate', $result);
  }

  /** * Tests ConfigNamesMapper::getAddRouteName(). */
  public function testGetAddRouteName() {
    $result = $this->configNamesMapper->getAddRouteName();
    $expected = 'config_translation.item.add.' . $this->pluginDefinition['base_route_name'];
    $this->assertSame($expected$result);
  }

  
$language_name = '<strong>' . $this->t('@language (original)', ['@language' => $language->getName()]) . '</strong>';

        // Check access for the path/route for editing, so we can decide to         // include a link to edit or not.         $edit_access = $this->accessManager->checkNamedRoute($mapper->getBaseRouteName()$route_match->getRawParameters()->all()$this->account);

        // Build list of operations.         $operations = [];
        if ($edit_access) {
          $operations['edit'] = [
            'title' => $this->t('Edit'),
            'url' => Url::fromRoute($mapper->getBaseRouteName()$mapper->getBaseRouteParameters()['query' => ['destination' => $mapper->getOverviewPath()]]),
          ];
        }
      }
      else {
        $language_name = $language->getName();

        $operations = [];
        // If no translation exists for this language, link to add one.         if (!$mapper->hasTranslation($language)) {
          $operations['add'] = [
            'title' => $this->t('Add'),
            
Home | Imprint | This part of the site doesn't use cookies.