You are here

public function ProviderUrlParseTest::testYouTubeTimeIndex 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::testYouTubeTimeIndex()

Test the YouTube time index parsing.

@dataProvider youTubeTimeIndexTestCases

File

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

Class

ProviderUrlParseTest
Test that URL parsing for various providers is functioning.

Namespace

Drupal\Tests\video_embed_field\Unit

Code

public function testYouTubeTimeIndex($url, $expected) {
  $provider = new YouTube([
    'input' => $url,
  ], '', [], new MockHttpClient());
  $embed = $provider
    ->renderEmbedCode(100, 100, TRUE);
  $this
    ->assertEquals($expected, $embed['#query']['start']);
}