function AlertsJsonFeedTest::testAnnounceFeedUpdatedAndRemoved

Same name in other branches
  1. 10 core/modules/announcements_feed/tests/src/FunctionalJavascript/AlertsJsonFeedTest.php \Drupal\Tests\announcements_feed\FunctionalJavascript\AlertsJsonFeedTest::testAnnounceFeedUpdatedAndRemoved()

Check the status of the announcements when the feed is updated and removed.

File

core/modules/announcements_feed/tests/src/FunctionalJavascript/AlertsJsonFeedTest.php, line 59

Class

AlertsJsonFeedTest
Test the access announcement according to json feed changes.

Namespace

Drupal\Tests\announcements_feed\FunctionalJavascript

Code

public function testAnnounceFeedUpdatedAndRemoved() : void {
    $this->markTestSkipped('Skipped due to major version-specific logic. See https://www.drupal.org/project/drupal/issues/3359322');
    $this->drupalLogin($this->user);
    $this->drupalGet('<front>');
    $this->clickLink('Announcements');
    $this->waitForOffCanvasToOpen();
    $page_html = $this->getSession()
        ->getPage()
        ->getHtml();
    $this->assertStringNotContainsString('Only 10 - Drupal 106 is available and this feed is Updated', $page_html);
    // Change the feed url and reset temp storage.
    AnnounceTestHttpClientMiddleware::setAnnounceTestEndpoint('/announce-feed-json/updated');
    $this->drupalGet('<front>');
    $this->clickLink('Announcements');
    $this->waitForOffCanvasToOpen();
    $page_html = $this->getSession()
        ->getPage()
        ->getHtml();
    $this->assertStringContainsString('Only 10 - Drupal 106 is available and this feed is Updated', $page_html);
    $this->drupalLogout();
    // Change the feed url and reset temp storage.
    AnnounceTestHttpClientMiddleware::setAnnounceTestEndpoint('/announce-feed-json/removed');
    $this->drupalLogin($this->user);
    $this->drupalGet('<front>');
    $this->clickLink('Announcements');
    $this->waitForOffCanvasToOpen();
    $page_html = $this->getSession()
        ->getPage()
        ->getHtml();
    $this->assertStringNotContainsString('Only 10 - Drupal 106 is available and this feed is Updated', $page_html);
}

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