<?php

declare(strict_types=1);

namespace Drupal\Tests\ufc\Kernel;

use Drupal\Tests\UnitTestCase;

/**
 * @coversDefaultClass \Drupal\ufc\Services\FightImporter
 * @group ufc
 */
class WebScraperKernelTest extends UnitTestCase {

  protected $fighterImporter;

  public function setUp(): void {
    parent::setUp();
    $this->fighterImporter = $this->createMock('Drupal\ufc\Services\FighterImporter');
  }

  /**
   * @dataProvider extractFighterNamesDataProvider
   */
  public function testExtractFighterNames($test_input) {
    $this->assertEquals("1", 2, "These do not match.");
  }

  private function extractFighterNamesDataProvider(): array {
    return [
      ['
        <ul class="l-flex--4col-1to4">
        <li class="l-flex__item">
        <div class="node node--type-athlete node--view-mode-all-athletes-result ds-1col clearfix">
        <div class="c-listing-athlete-flipcard white">
        <div class="c-listing-athlete-flipcard__inner">
        <div class="c-listing-athlete-flipcard__front">
        <div class="c-listing-athlete__thumbnail">
        <div class="field field--name-image field--type-entity-reference field--label-hidden field__item">
        <div class="layout layout--onecol">
        <div class="layout__region layout__region--content">
        <img src="https://dmxg5wxfqgb4u.cloudfront.net/styles/teaser/s3/2022-07/ABDELWAHAB_HAMDY_07-30.png?h=a30e7339&amp;itok=hQJx5TxB" width="400" height="300" loading="lazy" class="image-style-teaser">
        </div>
        </div>
        </div>
        </div>
        <div class="c-listing-athlete__text">
        <span class="c-listing-athlete__nickname">
        <div class="field field--name-nickname field--type-string field--label-hidden">
        <div class="field__item">"The Hammer"</div>
        </div>
        </span>
        <span class="c-listing-athlete__name">
        Hamdy Abdelwahab
        </span>
        <span class="c-listing-athlete__title">
        <div class="field field--name-stats-weight-class field--type-entity-reference field--label-hidden field__items">
        <div class="field__item">Heavyweight</div>
        </div>
        </span>
        <span class="c-listing-athlete__record">5-0-0 (W-L-D)</span>
        </div>
        </div>
        <div class="c-listing-athlete-flipcard__back">
        <div class="c-listing-athlete__bgimg">
        <div class="field field--name-image-body-right field--type-entity-reference field--label-hidden field__item">
        <div class="layout layout--onecol">
        <div class="layout__region layout__region--content">
        <img src="https://dmxg5wxfqgb4u.cloudfront.net/styles/event_fight_card_upper_body_of_standing_athlete/s3/2022-07/ABDELWAHAB_HAMDY_R_07-30.png?itok=pAbtNV-r" width="185" height="580" loading="lazy" class="image-style-event-fight-card-upper-body-of-standing-athlete">
        </div>
        </div>
        </div>
        </div>
        <div class="c-listing-athlete-flipcard__text__back">
        <span class="c-listing-athlete__nickname">
        <div class="field field--name-nickname field--type-string field--label-hidden">
        <div class="field__item">"The Hammer"</div>
        </div>
        </span>
        <span class="c-listing-athlete__name">
        Hamdy Abdelwahab
        </span>
        </div>
        <div class="c-listing-athlete-flipcard__action">
        <a href="/athlete/hamdy-abdelwahab" class="e-button--black "><span class="e-button__text">
        Athlete Profile
        </span></a>
        </div>
        <div class="c-listing-athlete-flipcard__footer">
        <h4>Follow</h4>
        <ul class="c-listing-athlete-flipcard__social-menu">
        <li class="c-listing-athlete-flipcard__social-item">
        <a class="c-listing-athlete-flipcard__social-link" href="https://twitter.com/Hamdyabdelwah" target="_blank">
        <span class="c-listing-athlete-flipcard__social-icon">
        <span class="e-icon--small">
        <svg class="e-icon__svg">
        <title>Twitter</title>
        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/themes/custom/ufc/assets/svg/sprite-ui.svg#twitter"></use>
        </svg>
        </span>
        </span>
        </a>
        </li>
        <li class="c-listing-athlete-flipcard__social-item">
        <a class="c-listing-athlete-flipcard__social-link" href="https://instagram.com/hamdy.abdelwahab1" target="_blank">
        <span class="c-listing-athlete-flipcard__social-icon">
        <span class="e-icon--small">
        <svg class="e-icon__svg">
        <title>Instagram</title>
        <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/themes/custom/ufc/assets/svg/sprite-ui.svg#instagram"></use>
        </svg>
        </span>
        </span>
        </a>
        </li>
        </ul>
        </div>
        </div>
        </div>
        </div>
        </div>
        </li>
        </ul>
        ']
    ];
  }

}


