class WorkspaceAssociationStringIdsUpdatePathTest
Tests the update path for string IDs in workspace_association.
@group workspaces
Hierarchy
- class \Drupal\Tests\BrowserTestBase extends \PHPUnit\Framework\TestCase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\PhpUnitCompatibilityTrait, \Drupal\TestTools\Extension\DeprecationBridge\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait
- class \Drupal\FunctionalTests\Update\UpdatePathTestBase extends \Drupal\Tests\BrowserTestBase uses \Drupal\Tests\UpdatePathTestTrait
- class \Drupal\Tests\workspaces\Functional\Update\WorkspaceAssociationStringIdsUpdatePathTest extends \Drupal\FunctionalTests\Update\UpdatePathTestBase
- class \Drupal\FunctionalTests\Update\UpdatePathTestBase extends \Drupal\Tests\BrowserTestBase uses \Drupal\Tests\UpdatePathTestTrait
Expanded class hierarchy of WorkspaceAssociationStringIdsUpdatePathTest
File
-
core/
modules/ workspaces/ tests/ src/ Functional/ Update/ WorkspaceAssociationStringIdsUpdatePathTest.php, line 14
Namespace
Drupal\Tests\workspaces\Functional\UpdateView source
class WorkspaceAssociationStringIdsUpdatePathTest extends UpdatePathTestBase {
/**
* {@inheritdoc}
*/
protected $checkEntityFieldDefinitionUpdates = FALSE;
/**
* {@inheritdoc}
*/
protected function setDatabaseDumpFiles() : void {
$this->databaseDumpFiles = [
__DIR__ . '/../../../../../system/tests/fixtures/update/drupal-10.3.0.bare.standard.php.gz',
__DIR__ . '/../../../fixtures/update/workspaces.php',
];
}
/**
* Tests the update path for string IDs in workspace_association.
*/
public function testRunUpdates() : void {
$schema = \Drupal::database()->schema();
$find_primary_key_columns = new \ReflectionMethod(get_class($schema), 'findPrimaryKeyColumns');
$this->assertFalse($schema->fieldExists('workspace_association', 'target_entity_id_string'));
$primary_key_columns = [
'workspace',
'target_entity_type_id',
'target_entity_id',
];
$this->assertEquals($primary_key_columns, $find_primary_key_columns->invoke($schema, 'workspace_association'));
$this->runUpdates();
$this->assertTrue($schema->fieldExists('workspace_association', 'target_entity_id_string'));
$primary_key_columns = [
'workspace',
'target_entity_type_id',
'target_entity_id',
'target_entity_id_string',
];
$this->assertEquals($primary_key_columns, $find_primary_key_columns->invoke($schema, 'workspace_association'));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.