function DefaultModerationStateTest::testDeleteDefaultStateAccess

Same name in other branches
  1. 9 core/modules/content_moderation/tests/src/Functional/DefaultModerationStateTest.php \Drupal\Tests\content_moderation\Functional\DefaultModerationStateTest::testDeleteDefaultStateAccess()
  2. 8.9.x core/modules/content_moderation/tests/src/Functional/DefaultModerationStateTest.php \Drupal\Tests\content_moderation\Functional\DefaultModerationStateTest::testDeleteDefaultStateAccess()
  3. 10 core/modules/content_moderation/tests/src/Functional/DefaultModerationStateTest.php \Drupal\Tests\content_moderation\Functional\DefaultModerationStateTest::testDeleteDefaultStateAccess()

Tests access to deleting the default state.

File

core/modules/content_moderation/tests/src/Functional/DefaultModerationStateTest.php, line 50

Class

DefaultModerationStateTest
Tests setting a custom default moderation state.

Namespace

Drupal\Tests\content_moderation\Functional

Code

public function testDeleteDefaultStateAccess() : void {
    $this->drupalGet('admin/config/workflow/workflows/manage/editorial/state/archived/delete');
    $this->assertSession()
        ->statusCodeEquals(200);
    $this->drupalGet('admin/config/workflow/workflows/manage/' . $this->workflow
        ->id());
    $this->submitForm([
        'type_settings[workflow_settings][default_moderation_state]' => 'archived',
    ], 'Save');
    $this->drupalGet('admin/config/workflow/workflows/manage/editorial/state/archived/delete');
    $this->assertSession()
        ->statusCodeEquals(403);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.