function LanguageNegotiationUrlTest::providerTestPathPrefix
Provides data for the path prefix test.
Return value
array An array of data for checking path prefix negotiation.
File
- 
              core/
modules/ language/ tests/ src/ Unit/ LanguageNegotiationUrlTest.php, line 113  
Class
- LanguageNegotiationUrlTest
 - @coversDefaultClass \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationUrl[[api-linebreak]] @group language
 
Namespace
Drupal\Tests\language\UnitCode
public function providerTestPathPrefix() {
  $path_prefix_configuration[] = [
    'prefix' => 'de',
    'prefixes' => [
      'de' => 'de',
      'en-uk' => 'en',
    ],
    'expected_langcode' => 'de',
  ];
  $path_prefix_configuration[] = [
    'prefix' => 'en-uk',
    'prefixes' => [
      'de' => 'de',
      'en' => 'en-uk',
    ],
    'expected_langcode' => 'en',
  ];
  // No configuration.
  $path_prefix_configuration[] = [
    'prefix' => 'de',
    'prefixes' => [],
    'expected_langcode' => FALSE,
  ];
  // Non-matching prefix.
  $path_prefix_configuration[] = [
    'prefix' => 'de',
    'prefixes' => [
      'en-uk' => 'en',
    ],
    'expected_langcode' => FALSE,
  ];
  // Non-existing language.
  $path_prefix_configuration[] = [
    'prefix' => 'it',
    'prefixes' => [
      'it' => 'it',
      'en-uk' => 'en',
    ],
    'expected_langcode' => FALSE,
  ];
  return $path_prefix_configuration;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.