public function UrlGeneratorTest::provideRelativePaths

File

drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php, line 510

Class

UrlGeneratorTest

Namespace

Symfony\Component\Routing\Tests\Generator

Code

public function provideRelativePaths() {
  return array(
    array(
      '/same/dir/',
      '/same/dir/',
      '',
    ),
    array(
      '/same/file',
      '/same/file',
      '',
    ),
    array(
      '/',
      '/file',
      'file',
    ),
    array(
      '/',
      '/dir/file',
      'dir/file',
    ),
    array(
      '/dir/file.html',
      '/dir/different-file.html',
      'different-file.html',
    ),
    array(
      '/same/dir/extra-file',
      '/same/dir/',
      './',
    ),
    array(
      '/parent/dir/',
      '/parent/',
      '../',
    ),
    array(
      '/parent/dir/extra-file',
      '/parent/',
      '../',
    ),
    array(
      '/a/b/',
      '/x/y/z/',
      '../../x/y/z/',
    ),
    array(
      '/a/b/c/d/e',
      '/a/c/d',
      '../../../c/d',
    ),
    array(
      '/a/b/c//',
      '/a/b/c/',
      '../',
    ),
    array(
      '/a/b/c/',
      '/a/b/c//',
      './/',
    ),
    array(
      '/root/a/b/c/',
      '/root/x/b/c/',
      '../../../x/b/c/',
    ),
    array(
      '/a/b/c/d/',
      '/a',
      '../../../../a',
    ),
    array(
      '/special-chars/sp%20ce/1€/mäh/e=mc²',
      '/special-chars/sp%20ce/1€/<µ>/e=mc²',
      '../<µ>/e=mc²',
    ),
    array(
      'not-rooted',
      'dir/file',
      'dir/file',
    ),
    array(
      '//dir/',
      '',
      '../../',
    ),
    array(
      '/dir/',
      '/dir/file:with-colon',
      './file:with-colon',
    ),
    array(
      '/dir/',
      '/dir/subdir/file:with-colon',
      'subdir/file:with-colon',
    ),
    array(
      '/dir/',
      '/dir/:subdir/',
      './:subdir/',
    ),
  );
}