diff --git a/core/modules/comment/lib/Drupal/comment/CommentManager.php b/core/modules/comment/lib/Drupal/comment/CommentManager.php index e144fb4..893333d 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentManager.php +++ b/core/modules/comment/lib/Drupal/comment/CommentManager.php @@ -329,10 +329,10 @@ public function forbiddenMessage(EntityInterface $entity, $field_name) { /** * {@inheritdoc} */ - public function getCountNewComments(EntityInterface $entity, $field_name = NULL, $timestamp = 0, AccountInterface $account = NULL) { + public function getCountNewComments(EntityInterface $entity, $field_name = NULL, $timestamp = 0) { // @todo Replace module handler with optional history service injection // after http://drupal.org/node/2081585 - if (\Drupal::currentUser()->isAuthenticated() && \Drupal::moduleHandler()->moduleExists('history')) { + if ($this->currentUser->isAuthenticated() && \Drupal::moduleHandler()->moduleExists('history')) { // Retrieve the timestamp at which the current user last viewed this entity. if (!$timestamp) { if ($entity->entityType() == 'node') { diff --git a/core/modules/comment/lib/Drupal/comment/CommentManagerInterface.php b/core/modules/comment/lib/Drupal/comment/CommentManagerInterface.php index e5a8f1d..c83f5ae 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentManagerInterface.php +++ b/core/modules/comment/lib/Drupal/comment/CommentManagerInterface.php @@ -117,13 +117,10 @@ public function forbiddenMessage(EntityInterface $entity, $field_name); * The field_name to count comments for. Defaults to any field. * @param int $timestamp * Time to count from. Defaults to time of last user access the entity. - * @param \Drupal\Core\Session\AccountInterface $account - * The user for which to count the new comments. Defaults to the current - * user. * * @return int|false * The number of new comments or FALSE if the user is not authenticated. */ - public function getCountNewComments(EntityInterface $entity, $field_name = NULL, $timestamp = 0, AccountInterface $account = NULL); + public function getCountNewComments(EntityInterface $entity, $field_name = NULL, $timestamp = 0); } diff --git a/core/modules/forum/tests/Drupal/forum/Tests/ForumManagerTest.php b/core/modules/forum/tests/Drupal/forum/Tests/ForumManagerTest.php index 1626e19..ee52b0a 100644 --- a/core/modules/forum/tests/Drupal/forum/Tests/ForumManagerTest.php +++ b/core/modules/forum/tests/Drupal/forum/Tests/ForumManagerTest.php @@ -9,12 +9,6 @@ use Drupal\Tests\UnitTestCase; -// @todo Remove once the constants are replaced with constants on classes. -// https://drupal.org/node/2169361 -if (!defined('COMMENT_OPEN')) { - define('COMMENT_OPEN', 2); -} - /** * Tests the ForumManager. *