You are here

public static function UrlHelperTest::providerTestParse in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php \Drupal\Tests\Component\Utility\UrlHelperTest::providerTestParse()

Provides data for self::testParse().

Return value

array

File

core/tests/Drupal/Tests/Component/Utility/UrlHelperTest.php, line 257
Contains \Drupal\Tests\Component\Utility\UrlHelperTest.

Class

UrlHelperTest
@group Utility

Namespace

Drupal\Tests\Component\Utility

Code

public static function providerTestParse() {
  return array(
    array(
      'http://www.example.com/my/path',
      array(
        'path' => 'http://www.example.com/my/path',
        'query' => array(),
        'fragment' => '',
      ),
    ),
    array(
      'http://www.example.com/my/path?destination=home#footer',
      array(
        'path' => 'http://www.example.com/my/path',
        'query' => array(
          'destination' => 'home',
        ),
        'fragment' => 'footer',
      ),
    ),
    array(
      'http://',
      array(
        'path' => '',
        'query' => array(),
        'fragment' => '',
      ),
    ),
    array(
      'https://',
      array(
        'path' => '',
        'query' => array(),
        'fragment' => '',
      ),
    ),
    array(
      '/my/path?destination=home#footer',
      array(
        'path' => '/my/path',
        'query' => array(
          'destination' => 'home',
        ),
        'fragment' => 'footer',
      ),
    ),
  );
}