public function UuidUpgradePathTest::testUuidUpgrade

Tests a successful point release update.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Upgrade/UuidUpgradePathTest.php, line 39
Definition of Drupal\system\Tests\Upgrade\UuidUpgradePathTest.

Class

UuidUpgradePathTest
Performs major version release upgrade tests on a populated database.

Namespace

Drupal\system\Tests\Upgrade

Code

public function testUuidUpgrade() {
  $this
    ->assertTrue($this
    ->performUpgrade(), 'The upgrade was completed successfully.');

  // Confirm that all {node} entries has uuid.
  $result = db_query('SELECT COUNT(*) FROM {comment} WHERE uuid IS NULL')
    ->fetchField();
  $this
    ->assertFalse($result, 'All comments has uuid assigned');

  // Confirm that all {node} entries has uuid.
  $result = db_query('SELECT COUNT(*) FROM {file_managed} WHERE uuid IS NULL')
    ->fetchField();
  $this
    ->assertFalse($result, 'All files has uuid assigned');

  // Confirm that all {node} entries has uuid.
  $result = db_query('SELECT COUNT(*) FROM {node} WHERE uuid IS NULL')
    ->fetchField();
  $this
    ->assertFalse($result, 'All nodes has uuid assigned');

  // Confirm that all {node} entries has uuid.
  $result = db_query('SELECT COUNT(*) FROM {taxonomy_term_data} WHERE uuid IS NULL')
    ->fetchField();
  $this
    ->assertFalse($result, 'All taxonomy terms has uuid assigned');

  // Confirm that all {user} entries has uuid.
  $result = db_query('SELECT COUNT(*) FROM {users} WHERE uuid IS NULL')
    ->fetchField();
  $this
    ->assertFalse($result, 'All users has uuid assigned');
}