Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / comment / tests / src / Unit / Entity / CommentLockTest.php
index e724dc6b89c5c14c4a9b8e415ae65cb64daa6cd5..1289a8e8c679988bbfae559d8debc9af2b6c2a94 100644 (file)
@@ -69,6 +69,14 @@ class CommentLockTest extends UnitTestCase {
       ->method('getThread')
       ->will($this->returnValue(''));
 
+    $anon_user = $this->getMock('Drupal\Core\Session\AccountInterface');
+    $anon_user->expects($this->any())
+      ->method('isAnonymous')
+      ->will($this->returnValue(TRUE));
+    $comment->expects($this->any())
+      ->method('getOwner')
+      ->will($this->returnValue($anon_user));
+
     $parent_entity = $this->getMock('\Drupal\Core\Entity\ContentEntityInterface');
     $parent_entity->expects($this->atLeastOnce())
       ->method('getCacheTagsToInvalidate')
@@ -81,10 +89,6 @@ class CommentLockTest extends UnitTestCase {
     $comment->expects($this->any())
       ->method('getEntityType')
       ->will($this->returnValue($entity_type));
-    $comment->expects($this->at(1))
-      ->method('get')
-      ->with('status')
-      ->will($this->returnValue((object) ['value' => NULL]));
     $storage = $this->getMock('Drupal\comment\CommentStorageInterface');
 
     // preSave() should acquire the lock. (This is what's really being tested.)