You are here

public function ImageStyleTest::fileUriScheme in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/image/tests/src/Unit/ImageStyleTest.php \Drupal\Tests\image\Unit\ImageStyleTest::fileUriScheme()

Mock function for ImageStyle::fileUriScheme().

File

core/modules/image/tests/src/Unit/ImageStyleTest.php, line 214
Contains \Drupal\Tests\image\Unit\ImageStyleTest.

Class

ImageStyleTest
@coversDefaultClass \Drupal\image\Entity\ImageStyle

Namespace

Drupal\Tests\image\Unit

Code

public function fileUriScheme($uri) {
  if (preg_match('/^([\\w\\-]+):\\/\\/|^(data):/', $uri, $matches)) {

    // The scheme will always be the last element in the matches array.
    return array_pop($matches);
  }
  return FALSE;
}