X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcomment%2Ftests%2Fsrc%2FUnit%2FEntity%2FCommentLockTest.php;h=1289a8e8c679988bbfae559d8debc9af2b6c2a94;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=e724dc6b89c5c14c4a9b8e415ae65cb64daa6cd5;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/modules/comment/tests/src/Unit/Entity/CommentLockTest.php b/web/core/modules/comment/tests/src/Unit/Entity/CommentLockTest.php index e724dc6b8..1289a8e8c 100644 --- a/web/core/modules/comment/tests/src/Unit/Entity/CommentLockTest.php +++ b/web/core/modules/comment/tests/src/Unit/Entity/CommentLockTest.php @@ -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.)