3 namespace Drupal\node\Tests\Update;
5 use Drupal\system\Tests\Update\UpdatePathTestBase;
8 * Tests that node settings are properly updated during database updates.
12 class NodeUpdateTest extends UpdatePathTestBase {
17 protected function setDatabaseDumpFiles() {
18 $this->databaseDumpFiles = [
19 __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8-rc1.bare.standard.php.gz',
24 * Tests that the node entity type has a 'published' entity key.
26 * @see node_update_8301()
28 public function testPublishedEntityKey() {
29 // Check that the 'published' entity key does not exist prior to the update.
30 $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('node');
31 $this->assertFalse($entity_type->getKey('published'));
36 // Check that the entity key exists and it has the correct value.
37 $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('node');
38 $this->assertEqual('status', $entity_type->getKey('published'));