function AnnounceFetcherUnitTest::urlProvider

Same name in other branches
  1. 11.x core/modules/announcements_feed/tests/src/Unit/AnnounceFetcherUnitTest.php \Drupal\Tests\announcements_feed\Unit\AnnounceFetcherUnitTest::urlProvider()

Data for the testValidateUrl.

File

core/modules/announcements_feed/tests/src/Unit/AnnounceFetcherUnitTest.php, line 60

Class

AnnounceFetcherUnitTest
Simple test to ensure that asserts pass.

Namespace

Drupal\Tests\announcements_feed\Unit

Code

public static function urlProvider() : array {
    return [
        [
            'https://www.drupal.org',
            TRUE,
        ],
        [
            'https://drupal.org',
            TRUE,
        ],
        [
            'https://api.drupal.org',
            TRUE,
        ],
        [
            'https://a.drupal.org',
            TRUE,
        ],
        [
            'https://123.drupal.org',
            TRUE,
        ],
        [
            'https://api-new.drupal.org',
            TRUE,
        ],
        [
            'https://api_new.drupal.org',
            TRUE,
        ],
        [
            'https://api-.drupal.org',
            TRUE,
        ],
        [
            'https://www.example.org',
            FALSE,
        ],
        [
            'https://example.org',
            FALSE,
        ],
        [
            'https://api.example.org/project/announce',
            FALSE,
        ],
        [
            'https://-api.drupal.org',
            FALSE,
        ],
        [
            'https://a.example.org/project/announce',
            FALSE,
        ],
        [
            'https://test.drupaal.com',
            FALSE,
        ],
        [
            'https://api.drupal.org.example.com',
            FALSE,
        ],
        [
            'https://example.org/drupal.org',
            FALSE,
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.