function IconFinderTest::providerGetFileContents

Data provider for ::testGetFileContents().

Return value

array The test cases as uri and expected valid.

File

core/tests/Drupal/Tests/Core/Theme/Icon/IconFinderTest.php, line 802

Class

IconFinderTest
@coversDefaultClass \Drupal\Core\Theme\Icon\IconFinder[[api-linebreak]]

Namespace

Drupal\Tests\Core\Theme\Icon

Code

public static function providerGetFileContents() : array {
  return [
    'valid local file' => [
      DRUPAL_ROOT . '/' . self::TEST_ICONS_PATH . '/icons/flat/foo.svg',
      TRUE,
    ],
    'do not exist' => [
      DRUPAL_ROOT . '/' . self::TEST_ICONS_PATH . '/icons/do/not/exist.svg',
      FALSE,
    ],
    [
      'http://foo.com/bar.png',
      FALSE,
    ],
    [
      'https://foo.com/bar.png',
      FALSE,
    ],
    [
      'ftp://foo.com/bar.png',
      FALSE,
    ],
    [
      'ssh://foo.com/bar.png',
      FALSE,
    ],
    [
      '//foo.com/bar.png',
      FALSE,
    ],
  ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.