commit 92c18d134ca5f6e14987b2f28ea00602555ca9f0 Author: Andy Postnikov Date: Wed Mar 22 02:30:01 2017 +0200 p61 diff --git a/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php b/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php index 2b320ae..4dd32df 100644 --- a/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php +++ b/core/modules/tracker/tests/src/Functional/TrackerNodeAccessTest.php @@ -4,6 +4,7 @@ use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface; use Drupal\comment\Tests\CommentTestTrait; +use Drupal\field\Entity\FieldStorageConfig; use Drupal\node\Entity\NodeType; use Drupal\Tests\BrowserTestBase; @@ -61,6 +62,8 @@ public function testTrackerNodeAccess() { $this->drupalGet('user/' . $access_user->id() . '/activity'); $this->assertText($private_node->getTitle(), 'Private node is visible to user with private access.'); $this->assertText($public_node->getTitle(), 'Public node is visible to user with private access.'); + // Comments column displayed. + $this->assertSession()->pageTextContains('Comments'); // User without access should not see private node. $this->drupalLogin($no_access_user); @@ -70,6 +73,23 @@ public function testTrackerNodeAccess() { $this->drupalGet('user/' . $access_user->id() . '/activity'); $this->assertNoText($private_node->getTitle(), 'Private node is not visible to user without private access.'); $this->assertText($public_node->getTitle(), 'Public node is visible to user without private access.'); + + // Ensure module pages works when comment module uninstalled. + $field = FieldStorageConfig::loadByName('node', 'comment'); + $field->delete(); + field_purge_batch(10); + /** @var \Drupal\Core\Extension\ModuleInstallerInterface $service */ + $service = \Drupal::service('module_installer'); + $service->uninstall(['comment']); + $this->drupalLogin($access_user); + $this->drupalGet('activity'); + $this->assertSession()->pageTextContains($private_node->getTitle()); + // Comments column hidden. + $this->assertSession()->pageTextNotContains('Comments'); + $this->drupalGet('user/' . $access_user->id() . '/activity'); + $this->assertSession()->pageTextContains($private_node->getTitle()); + // Comments column hidden. + $this->assertSession()->pageTextNotContains('Comments'); } }