function AnnounceFetcherTest::testShowAnnouncements

Same name and namespace in other branches
  1. 10 core/modules/announcements_feed/tests/src/Kernel/AnnounceFetcherTest.php \Drupal\Tests\announcements_feed\Kernel\AnnounceFetcherTest::testShowAnnouncements()

Tests announcement that should be displayed.

@dataProvider providerShowAnnouncements

Parameters

mixed[] $feed_item: The feed item to test. 'title' and 'url' are omitted from this array because they do not need to vary between test cases.

File

core/modules/announcements_feed/tests/src/Kernel/AnnounceFetcherTest.php, line 33

Class

AnnounceFetcherTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21announcements_feed%21src%21AnnounceFetcher.php/class/AnnounceFetcher/11.x" title="Service to fetch announcements from the external feed." class="local">\Drupal\announcements_feed\AnnounceFetcher</a>

Namespace

Drupal\Tests\announcements_feed\Kernel

Code

public function testShowAnnouncements(array $feed_item) : void {
    $this->markTestSkipped('Skipped due to major version-specific logic. See https://www.drupal.org/project/drupal/issues/3359322');
    $this->setFeedItems([
        $feed_item,
    ]);
    $feeds = $this->fetchFeedItems();
    $this->assertCount(1, $feeds);
    $this->assertSame('https://www.drupal.org/project/announce', $feeds[0]->url);
    $this->assertSame('Drupal security update Test', $feeds[0]->title);
    $this->assertSame('^10', $feeds[0]->version);
    $this->assertCount(1, $this->history);
}

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