function AnnounceFetcherTest::fetchFeedItems

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

Gets the announcements from the 'announce.fetcher' service.

Return value

\Drupal\announcements_feed\Announcement[] The return value of AnnounceFetcher::fetch().

2 calls to AnnounceFetcherTest::fetchFeedItems()
AnnounceFetcherTest::testFeedFields in core/modules/announcements_feed/tests/src/Kernel/AnnounceFetcherTest.php
Tests feed fields.
AnnounceFetcherTest::testShowAnnouncements in core/modules/announcements_feed/tests/src/Kernel/AnnounceFetcherTest.php
Tests announcement that should be displayed.

File

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

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

protected function fetchFeedItems() : array {
    return $this->container
        ->get('announcements_feed.fetcher')
        ->fetch();
}

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