function AnnounceTestHttpClientMiddleware::setAnnounceTestEndpoint
Sets the test endpoint for the advisories JSON feed.
Parameters
string $test_endpoint: The test endpoint.
5 calls to AnnounceTestHttpClientMiddleware::setAnnounceTestEndpoint()
- AccessAnnouncementTest::setUp in core/modules/ announcements_feed/ tests/ src/ FunctionalJavascript/ AccessAnnouncementTest.php 
- AlertsJsonFeedTest::setUp in core/modules/ announcements_feed/ tests/ src/ FunctionalJavascript/ AlertsJsonFeedTest.php 
- AlertsJsonFeedTest::testAnnounceFeedEmpty in core/modules/ announcements_feed/ tests/ src/ FunctionalJavascript/ AlertsJsonFeedTest.php 
- Check with an empty JSON feed.
- AlertsJsonFeedTest::testAnnounceFeedUpdatedAndRemoved in core/modules/ announcements_feed/ tests/ src/ FunctionalJavascript/ AlertsJsonFeedTest.php 
- Check the status of the announcements when the feed is updated and removed.
- AnnounceBlockTest::setUp in core/modules/ announcements_feed/ tests/ src/ FunctionalJavascript/ AnnounceBlockTest.php 
File
- 
              core/modules/ announcements_feed/ tests/ modules/ announce_feed_test/ src/ AnnounceTestHttpClientMiddleware.php, line 40 
Class
- AnnounceTestHttpClientMiddleware
- Overrides the requested endpoint when running tests.
Namespace
Drupal\announce_feed_testCode
public static function setAnnounceTestEndpoint(string $test_endpoint) : void {
  // Convert the endpoint to an absolute URL.
  $test_endpoint = Url::fromUri('base:/' . $test_endpoint)->setAbsolute()
    ->toString();
  \Drupal::state()->set('announce_test_endpoint', $test_endpoint);
  \Drupal::service('keyvalue.expirable')->get('announcements_feed')
    ->delete('announcements');
  Cache::invalidateTags([
    'announcements_feed:feed',
  ]);
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
