You are here

public function EntityDefinitionUpdateTest::testNoUpdates in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php \Drupal\system\Tests\Entity\EntityDefinitionUpdateTest::testNoUpdates()

Tests when no definition update is needed.

File

core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php, line 84
Contains \Drupal\system\Tests\Entity\EntityDefinitionUpdateTest.

Class

EntityDefinitionUpdateTest
Tests EntityDefinitionUpdateManager functionality.

Namespace

Drupal\system\Tests\Entity

Code

public function testNoUpdates() {

  // Ensure that the definition update manager reports no updates.
  $this
    ->assertFalse($this->entityDefinitionUpdateManager
    ->needsUpdates(), 'EntityDefinitionUpdateManager reports that no updates are needed.');
  $this
    ->assertIdentical($this->entityDefinitionUpdateManager
    ->getChangeSummary(), array(), 'EntityDefinitionUpdateManager reports an empty change summary.');

  // Ensure that applyUpdates() runs without error (it's not expected to do
  // anything when there aren't updates).
  $this->entityDefinitionUpdateManager
    ->applyUpdates();
}