Skip to content
Snippets Groups Projects
Verified Commit dd3cad2d authored by Jess's avatar Jess
Browse files

Issue #3401764 by BramDriesen, xjm, smustgrave: Replace CollegeHumor URLs and...

Issue #3401764 by BramDriesen, xjm, smustgrave: Replace CollegeHumor URLs and logic in core test cases

(cherry picked from commit 8087bc58)
parent 72d9d9ba
Branches
Tags
20 merge requests!8376Drupal views: adding more granularity to the ‘use ajax’ functionality,!8300Issue #3443586 View area displays even when parent view has no results.,!7567Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7565Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7509Change label "Block description" to "Block type",!7344Issue #3292350 by O'Briat, KlemenDEV, hswong3i, smustgrave, quietone: Update...,!6922Issue #3412959 by quietone, smustgrave, longwave: Fix 12 'un' words,!6848Issue #3417553 by longwave: Remove withConsecutive() in CacheCollectorTest,!6720Revert "Issue #3358581 by pfrenssen, _tarik_, a.dmitriiev, smustgrave:...,!6560Update ClaroPreRender.php, confirming classes provided are in array format,!6528Issue #3414261 by catch: Add authenticated user umami performance tests,!6501Issue #3263668 by omkar-pd, Wim Leers, hooroomoo: Re-enable inline form errors...,!6354Draft: Issue #3380392 by phma: Updating language weight from the overview reverts label if translated,!6324Issue #3416723 by Ludo.R: Provide a "node type" views default argument,!6119Issue #3405704 by Spokje, longwave: symfony/psr-http-message-bridge major version bump,!5950Issue #3403653 by alexpott, longwave: Incorporate improvements to how contrib runs PHPStan to core,!5858Issue #3401971 by fjgarlin: Test-only job shouldn't require constant rebases...,!5716Draft: Issue #3401102 by Spokje, longwave, smustgrave: Nightwatch artifacts on GitLab not retained,!5674Transaction autocommit during shutdown relies on unreliable object destruction order,!5644Issue #3395563 by nireneko, marvil07, lauriii, borisson_, smustgrave, Wim...
Pipeline #51147 passed
Pipeline: drupal

#51148

    ......@@ -170,7 +170,6 @@ cnenzrgre
    codesniffer
    colgroups
    colinodell
    collegehumor
    colonpos
    colour
    colspans
    ......@@ -211,6 +210,7 @@ customly
    customrequest
    cweagans
    cádiz
    dailymotion
    databasename
    datas
    datelist
    ......
    ......@@ -27,19 +27,18 @@
    "https:\/\/*.twitter.com\/*\/status\/*"
    ],
    "url": "https:\/\/publish.twitter.com\/oembed"
    }
    ]
    },
    {
    "provider_name": "CollegeHumor",
    "provider_url": "http:\/\/www.collegehumor.com\/",
    "provider_name": "Dailymotion",
    "provider_url": "https:\/\/www.dailymotion.com\/",
    "endpoints": [
    {
    "schemes": [
    "http:\/\/www.collegehumor.com\/video\/*"
    "https:\/\/www.dailymotion.com\/video\/*"
    ],
    "url": "http:\/\/www.collegehumor.com\/oembed.{format}",
    "url": "https:\/\/www.dailymotion.com\/services\/oembed",
    "discovery": true
    }
    ]
    ......
    <!DOCTYPE html>
    <html lang="de">
    <head>
    <link rel="alternate" href="video_collegehumor.xml"
    type="application/xml+oembed" title="Let&#039;s Not Get a Drink Sometime">
    <link rel="alternate" href="video_dailymotion.xml"
    type="application/xml+oembed" title="#d8rules - Support the Rules module for Drupal 8">
    </head>
    <body></body>
    </html>
    ......@@ -2,15 +2,15 @@
    <oembed>
    <type>video</type>
    <version>1.0</version>
    <title>Let's Not Get a Drink Sometime</title>
    <title>#d8rules - Support the Rules module for Drupal 8</title>
    <https/>
    <author_name>CollegeHumor</author_name>
    <author_url>http://www.collegehumor.com</author_url>
    <provider_name>CollegeHumor</provider_name>
    <provider_url>http://www.collegehumor.com</provider_url>
    <author_name>Leepchic</author_name>
    <author_url>https://www.dailymotion.com/leepchic</author_url>
    <provider_name>Dailymotion</provider_name>
    <provider_url>https://www.dailymotion.com</provider_url>
    <width>610</width>
    <height>343</height>
    <html><h1>CollegeHumor works!</h1>
    <html><h1>Dailymotion works!</h1>
    </html>
    <!-- The thumbnail URL does not contain a file extension, so we use
    this to test the oEmbed source plugin's thumbnail handling;
    ......
    ......@@ -43,9 +43,9 @@ public function providerFetchResource() {
    'Drupal Rap Video - Schipulcon09',
    ],
    'XML resource' => [
    'video_collegehumor.xml',
    'CollegeHumor',
    "Let's Not Get a Drink Sometime",
    'video_dailymotion.xml',
    'Dailymotion',
    "#d8rules - Support the Rules module for Drupal 8",
    ],
    ];
    }
    ......
    ......@@ -47,9 +47,9 @@ public function providerEndpointMatching() {
    'https://vimeo.com/14782834',
    'https://vimeo.com/api/oembed.json?url=https://vimeo.com/14782834',
    ],
    'match by endpoint: CollegeHumor' => [
    'http://www.collegehumor.com/video/40002870/lets-not-get-a-drink-sometime',
    'http://www.collegehumor.com/oembed.json?url=http://www.collegehumor.com/video/40002870/lets-not-get-a-drink-sometime',
    'match by endpoint: Dailymotion' => [
    'https://www.dailymotion.com/video/x2vzluh',
    'https://www.dailymotion.com/services/oembed?url=https://www.dailymotion.com/video/x2vzluh',
    ],
    'match by endpoint: Facebook' => [
    'https://www.facebook.com/facebook/videos/10153231379946729/',
    ......@@ -106,13 +106,8 @@ public function providerUrlDiscovery() {
    'https://vimeo.com/api/oembed.json?url=video_vimeo.html',
    ],
    'XML resource' => [
    'video_collegehumor.html',
    // The endpoint does not explicitly declare that it supports XML, so
    // only JSON support is assumed, which is why the discovered URL
    // contains '.json'. However, the fetched HTML file contains a
    // relationship to an XML representation of the resource, with the
    // application/xml+oembed MIME type.
    'http://www.collegehumor.com/oembed.json?url=video_collegehumor.html',
    'video_dailymotion.html',
    'https://www.dailymotion.com/services/oembed?url=video_dailymotion.html',
    ],
    ];
    }
    ......
    ......@@ -160,22 +160,22 @@ public function testMediaOEmbedVideoSource() {
    // Try to create a media asset from a disallowed provider.
    $this->drupalGet("media/add/$media_type_id");
    $assert_session->fieldExists('Remote video URL')->setValue('http://www.collegehumor.com/video/40003213/grant-and-katie-are-starting-their-own-company');
    $assert_session->fieldExists('Remote video URL')->setValue('https://www.dailymotion.com/video/x2vzluh');
    $page->pressButton('Save');
    $assert_session->pageTextContains('The CollegeHumor provider is not allowed.');
    $assert_session->pageTextContains('The Dailymotion provider is not allowed.');
    // Register a CollegeHumor video as a second oEmbed resource. Note that its
    // Register a Dailymotion video as a second oEmbed resource. Note that its
    // thumbnail URL does not have a file extension.
    $media_type = MediaType::load($media_type_id);
    $source_configuration = $media_type->getSource()->getConfiguration();
    $source_configuration['providers'][] = 'CollegeHumor';
    $source_configuration['providers'][] = 'Dailymotion';
    $media_type->getSource()->setConfiguration($source_configuration);
    $media_type->save();
    $video_url = 'http://www.collegehumor.com/video/40003213/let-not-get-a-drink-sometime';
    ResourceController::setResourceUrl($video_url, $this->getFixturesDirectory() . '/video_collegehumor.xml');
    $video_url = 'https://www.dailymotion.com/video/x2vzluh';
    ResourceController::setResourceUrl($video_url, $this->getFixturesDirectory() . '/video_dailymotion.xml');
    // Create a new media item using a CollegeHumor video.
    // Create a new media item using a Dailymotion video.
    $this->drupalGet("media/add/$media_type_id");
    $assert_session->fieldExists('Remote video URL')->setValue($video_url);
    $assert_session->buttonExists('Save')->press();
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment