Commit 23eb4f86 authored by catch's avatar catch
Browse files

Issue #3555375 by quietone, andypost, dcam: Change use of Contact in...

Issue #3555375 by quietone, andypost, dcam: Change use of Contact in \Drupal\Tests\user\Functional\UserPermissionsTest::testAccessBundlePermission

(cherry picked from commit ca1bb67e)
parent 7fa679cb
Loading
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -275,18 +275,18 @@ public function testAccessModulePermission(): void {
  public function testAccessBundlePermission(): void {
    $this->drupalLogin($this->adminUser);

    \Drupal::service('module_installer')->install(['contact', 'taxonomy']);
    $this->grantPermissions(Role::load($this->rid), ['administer contact forms', 'administer taxonomy']);
    \Drupal::service('module_installer')->install(['comment', 'taxonomy']);
    $this->grantPermissions(Role::load($this->rid), ['administer comment types', 'administer taxonomy']);

    // Bundles that do not have permissions have no permissions pages.
    $edit = [];
    $edit['label'] = 'Test contact type';
    $edit['id'] = 'test_contact_type';
    $edit['recipients'] = 'webmaster@example.com';
    $this->drupalGet('admin/structure/contact/add');
    $edit['label'] = 'Test bundle type';
    $edit['id'] = 'test_bundle_type';
    $edit['target_entity_type_id'] = 'taxonomy_term';
    $this->drupalGet('admin/structure/comment/types/add');
    $this->submitForm($edit, 'Save');
    $this->assertSession()->pageTextContains('Contact form ' . $edit['label'] . ' has been added.');
    $this->drupalGet('admin/structure/contact/manage/test_contact_type/permissions');
    $this->assertSession()->pageTextContains('Comment type ' . $edit['label'] . ' has been added.');
    $this->drupalGet('admin/structure/comment/manage/test_bundle_type/permissions');
    $this->assertSession()->statusCodeEquals(200);
    $this->assertSession()->pageTextContains('No permissions found.');

@@ -312,7 +312,7 @@ public function testAccessBundlePermission(): void {
    $this->drupalLogout();
    $this->drupalGet('admin/structure/taxonomy/manage/test_vocabulary/overview/permissions');
    $this->assertSession()->statusCodeEquals(403);
    $this->drupalGet('admin/structure/contact/manage/test_contact_type/permissions');
    $this->drupalGet('admin/structure/comment/manage/test_bundle_type/permissions');
    $this->assertSession()->statusCodeEquals(403);
  }