You are here

public function UpdateRecommenderTest::testNoUpdateAvailable in Automatic Updates 8.2

Tests fetching the recommended release when there is no update available.

File

tests/src/Kernel/UpdateRecommenderTest.php, line 37

Class

UpdateRecommenderTest
@covers \Drupal\automatic_updates\UpdateRecommender

Namespace

Drupal\Tests\automatic_updates\Kernel

Code

public function testNoUpdateAvailable() : void {
  $this
    ->setCoreVersion('9.8.1');
  $recommender = new UpdateRecommender();
  $recommended_release = $recommender
    ->getRecommendedRelease(TRUE);
  $this
    ->assertNull($recommended_release);

  // Getting the recommended release again should not trigger another request.
  $this
    ->assertNull($recommender
    ->getRecommendedRelease());
}