ContentModerationUpdateTest.php in Drupal 8
File
core/modules/content_moderation/tests/src/Functional/Update/ContentModerationUpdateTest.php
View source
<?php
namespace Drupal\Tests\content_moderation\Functional\Update;
use Drupal\FunctionalTests\Update\UpdatePathTestBase;
class ContentModerationUpdateTest extends UpdatePathTestBase {
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.4.0.bare.standard.php.gz',
__DIR__ . '/../../../fixtures/update/drupal-8.4.0-content_moderation_installed.php',
];
}
public function testOwnerEntityKey() {
$entity_type = \Drupal::entityDefinitionUpdateManager()
->getEntityType('content_moderation_state');
$this
->assertFalse($entity_type
->getKey('owner'));
$this
->runUpdates();
$entity_type = \Drupal::entityDefinitionUpdateManager()
->getEntityType('content_moderation_state');
$this
->assertEquals('uid', $entity_type
->getKey('owner'));
}
}