getDeleteRouteParameters example

$this->assertSame($expected$result);
  }

  /** * Tests ConfigNamesMapper::getDeleteRouteParameters(). */
  public function testGetDeleteRouteParameters() {
    $route_match = new RouteMatch('example', new Route('/test/{langcode}')['langcode' => 'xx']);
    $this->configNamesMapper->populateFromRouteMatch($route_match);

    $expected = ['langcode' => 'xx'];
    $result = $this->configNamesMapper->getDeleteRouteParameters();
    $this->assertSame($expected$result);
  }

  /** * Tests ConfigNamesMapper::getRoute(). */
  public function testGetDeleteRoute() {
    $expected = new Route('/admin/config/system/site-information/translate/{langcode}/delete',
      [
        '_form' => '\Drupal\config_translation\Form\ConfigTranslationDeleteForm',
        'plugin_id' => 'system.site_information_settings',
      ],

        }
        else {
          // Otherwise, link to edit the existing translation.           $operations['edit'] = [
            'title' => $this->t('Edit'),
            'url' => Url::fromRoute($mapper->getEditRouteName()$mapper->getEditRouteParameters()),
          ];

          $operations['delete'] = [
            'title' => $this->t('Delete'),
            'url' => Url::fromRoute($mapper->getDeleteRouteName()$mapper->getDeleteRouteParameters()),
          ];
        }
      }

      $page['languages'][$langcode]['language'] = [
        '#markup' => $language_name,
      ];

      $page['languages'][$langcode]['operations'] = [
        '#type' => 'operations',
        '#links' => $operations,
        
Home | Imprint | This part of the site doesn't use cookies.