function WorkspaceTest::doTestWorkspaceFormRevisions
Same name and namespace in other branches
- main core/modules/workspaces/tests/src/Functional/WorkspaceTest.php \Drupal\Tests\workspaces\Functional\WorkspaceTest::doTestWorkspaceFormRevisions()
Tests that editing a workspace creates a new revision.
1 call to WorkspaceTest::doTestWorkspaceFormRevisions()
- WorkspaceTest::testWorkspaces in core/
modules/ workspaces/ tests/ src/ Functional/ WorkspaceTest.php - Test workspace functionality.
File
-
core/
modules/ workspaces/ tests/ src/ Functional/ WorkspaceTest.php, line 170
Class
- WorkspaceTest
- Test the workspace entity.
Namespace
Drupal\Tests\workspaces\FunctionalCode
protected function doTestWorkspaceFormRevisions() : void {
$this->drupalLogin($this->editor1);
$storage = \Drupal::entityTypeManager()->getStorage('workspace');
$this->createWorkspaceThroughUi('Stage', 'stage');
// The current 'stage' workspace entity should be revision 4.
$stage_workspace = $storage->load('stage');
$this->assertEquals('4', $stage_workspace->getRevisionId());
// Re-save the 'stage' workspace via the UI to create revision 5.
$this->drupalGet($stage_workspace->toUrl('edit-form')
->toString());
$this->submitForm([], 'Save');
$stage_workspace = $storage->loadUnchanged('stage');
$this->assertEquals('5', $stage_workspace->getRevisionId());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.