Skip to content
Snippets Groups Projects

Resolve #3439832 "Content moderation test"

Open Pooja Sharma requested to merge issue/drupal-3439832:3439832-content-moderation-test into 11.x
4 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
87 79 $node->moderation_state->value = 'draft';
88 80 $node->save();
89 81
82 $this->adminUser->addRole($this->createRole(['use editorial transition publish']))->save();
  • 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();
  • Pooja Sharma added 1 commit

    added 1 commit

    • 39362bb7 - issue/3439832: Applied suggestions EntityStateChangeValidationTest

    Compare with previous version

  • Pooja Sharma added 1 commit

    added 1 commit

    • 1e991934 - issue/3439832: Applied grant perm() ModerationContentTranslationTest

    Compare with previous version

  • 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.

    • Please register or sign in to reply
  • Pooja Sharma added 370 commits

    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

    Compare with previous version

  • Pooja Sharma added 1 commit

    added 1 commit

    • 7c0035e6 - issue/3439832: Applied suggestions.

    Compare with previous version

  • Pooja Sharma added 1 commit

    added 1 commit

    • d3b5355a - issue/3439832: fixing spacing.

    Compare with previous version

  • 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 }
    Please register or sign in to reply
    Loading