You are here

public function UpdateRecommenderTest::testUpdateAvailable in Automatic Updates 8.2

Tests fetching the recommended release when an update is available.

File

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

Class

UpdateRecommenderTest
@covers \Drupal\automatic_updates\UpdateRecommender

Namespace

Drupal\Tests\automatic_updates\Kernel

Code

public function testUpdateAvailable() : void {
  $recommender = new UpdateRecommender();
  $recommended_release = $recommender
    ->getRecommendedRelease(TRUE);
  $this
    ->assertNotEmpty($recommended_release);
  $this
    ->assertSame('9.8.1', $recommended_release
    ->getVersion());

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