You are here

public function ProviderUrlParseTest::vimeoTimeIndexTestCases in Video Embed Field 8

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/ProviderUrlParseTest.php \Drupal\Tests\video_embed_field\Unit\ProviderUrlParseTest::vimeoTimeIndexTestCases()

A data provider for testVimeoTimeIndex.

Return value

array An array of test cases.

File

tests/src/Unit/ProviderUrlParseTest.php, line 316

Class

ProviderUrlParseTest
Test that URL parsing for various providers is functioning.

Namespace

Drupal\Tests\video_embed_field\Unit

Code

public function vimeoTimeIndexTestCases() {
  return [
    'Standard time index' => [
      'https://vimeo.com/193517656#t=150s',
      't=150s',
      FALSE,
    ],
    'Empty start time' => [
      'https://vimeo.com/193517656#t=',
      NULL,
      TRUE,
    ],
    'Empty start time (with seconds)' => [
      'https://vimeo.com/193517656#t=s',
      NULL,
      TRUE,
    ],
    'Non numeric start time' => [
      'https://vimeo.com/193517656#t=STARTs',
      NULL,
      TRUE,
    ],
    'Non t fragment' => [
      'https://vimeo.com/193517656#o=150s',
      NULL,
      TRUE,
    ],
    'No seconds' => [
      'https://vimeo.com/193517656#t=15',
      NULL,
      TRUE,
    ],
  ];
}