Resolve #3439832 "Content moderation test"
Merge request reports
Activity
added 1 commit
- a9d99ea7 - issue/3439832: Updated ModerationStateBlockTest
added 1 commit
- a434526c - issue/3439832: Updated EntityStateChangeValidationTest
added 1 commit
- bd82209f - issue/3439832: Updated WorkspaceContentModerationIntegrationTest
added 1 commit
- e6602b68 - issue/3439832: Updated ModerationContentTranslationTest
added 1 commit
- 8fdd7ac7 - issue/3439832: Updated ModerationContentTranslationTest
added 1 commit
- 59356f12 - issue/3439832: Revert back ModerationContentTranslationTest
added 396 commits
-
8cd02c7f...e81e6f86 - 396 commits from branch
project:11.x
-
8cd02c7f...e81e6f86 - 396 commits from branch
added 1 commit
- dbde771f - issue/3439832: Removed superuser & added permissions to content moderation tests.
87 79 $node->moderation_state->value = 'draft'; 88 80 $node->save(); 89 81 82 $this->adminUser->addRole($this->createRole(['use editorial transition publish']))->save(); Similarly here user created first after it
$workflow = $this->createEditorialWorkflow();
workflow config created at line no 71 & permission can not be assign before it & necessary can be assign by adding role.Edited by Pooja Sharmachanged this line in version 10 of the diff
93 90 $workflow = $this->createEditorialWorkflow(); 94 91 $workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'article'); 95 92 $workflow->save(); 96 $this->drupalLogin($this->rootUser); 93 $this->adminUser->addRole($this->drupalCreateRole(['use editorial transition publish']))->save(); changed this line in version 11 of the diff
added 1 commit
- 39362bb7 - issue/3439832: Applied suggestions EntityStateChangeValidationTest
added 1 commit
- 1e991934 - issue/3439832: Applied grant perm() ModerationContentTranslationTest
91 89 $workflow = $this->createEditorialWorkflow(); 92 90 $workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'article'); 93 91 $workflow->save(); 94 $this->drupalLogin($this->rootUser); 92 $this->grantPermissions(Role::load(Role::AUTHENTICATED_ID), ['use editorial transition publish']); without this MR changes: 23 output HTML files generated
with this MR change: 16 output HTML files generated
Here from page no. 11 - 17 files remove as compare to old test files, bcoz we have added "grantPerm()" that keeps login user with other provide required perms, on the other hand in old test files, "drupalLogin()" used that makes same user logout then login again which leads to generate additional 7 HTML files output.
I feel this diff of HTNL files with this MR changes, kind of advantage of providing perms to newly created user & remove the superuser that leads to improve test from optimization perspective as well.
added 370 commits
-
1e991934...6e8300b1 - 367 commits from branch
project:11.x
- efbf3598 - issue/3439832: Removed superuser & added permissions to content moderation tests.
- 7f38be5d - issue/3439832: Applied suggestions EntityStateChangeValidationTest
- add040bc - issue/3439832: Applied grant perm() ModerationContentTranslationTest
Toggle commit list-
1e991934...6e8300b1 - 367 commits from branch
20 * @todo Remove and fix test to not rely on super user. 21 * @see https://www.drupal.org/project/drupal/issues/3437620 22 19 */ 23 protected bool $usesSuperUserAccessPolicy = TRUE; 20 protected $defaultTheme = 'stark'; 24 21 25 22 /** 26 23 * {@inheritdoc} 27 24 */ 28 protected $defaultTheme = 'stark'; 25 protected function getAdministratorPermissions(): array { 26 return array_merge($this->permissions, [ 27 'administer blocks', 28 'administer block content', 29 ]); 30 }