function WorkspaceIntegrationTest::testPublishWorkspaceDedicatedTableStorage
Same name in other branches
- 9 core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php \Drupal\Tests\workspaces\Kernel\WorkspaceIntegrationTest::testPublishWorkspaceDedicatedTableStorage()
- 8.9.x core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php \Drupal\Tests\workspaces\Kernel\WorkspaceIntegrationTest::testPublishWorkspaceDedicatedTableStorage()
- 10 core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php \Drupal\Tests\workspaces\Kernel\WorkspaceIntegrationTest::testPublishWorkspaceDedicatedTableStorage()
Tests publishing with fields in dedicated table storage.
File
-
core/
modules/ workspaces/ tests/ src/ Kernel/ WorkspaceIntegrationTest.php, line 1083
Class
- WorkspaceIntegrationTest
- Tests a complete publishing scenario across different workspaces.
Namespace
Drupal\Tests\workspaces\KernelCode
public function testPublishWorkspaceDedicatedTableStorage() : void {
$this->initializeWorkspacesModule();
$node_storage = $this->entityTypeManager
->getStorage('node');
$this->workspaceManager
->switchToLive();
$node = $node_storage->create([
'title' => 'Foo title',
// Use the body field on node as a test case because it requires dedicated
// table storage.
'body' => 'Foo body',
'type' => 'page',
]);
$node->save();
$this->switchToWorkspace('stage');
$node->title = 'Bar title';
$node->body = 'Bar body';
$node->save();
$this->workspaces['stage']
->publish();
$this->workspaceManager
->switchToLive();
$reloaded = $node_storage->load($node->id());
$this->assertEquals('Bar title', $reloaded->title->value);
$this->assertEquals('Bar body', $reloaded->body->value);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.