.../tests/Drupal/comment/Tests/Entity/CommentLockTest.php | 8 ++++++++ .../Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php | 2 +- core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/modules/comment/tests/Drupal/comment/Tests/Entity/CommentLockTest.php b/core/modules/comment/tests/Drupal/comment/Tests/Entity/CommentLockTest.php index 1d54be4..48010ec 100644 --- a/core/modules/comment/tests/Drupal/comment/Tests/Entity/CommentLockTest.php +++ b/core/modules/comment/tests/Drupal/comment/Tests/Entity/CommentLockTest.php @@ -35,6 +35,8 @@ public function testLocks() { $container = new ContainerBuilder(); $container->set('module_handler', $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface')); $container->set('current_user', $this->getMock('Drupal\Core\Session\AccountInterface')); + $container->set('cache.test', $this->getMock('Drupal\Core\Cache\CacheBackendInterface')); + $container->setParameter('cache_bins', array('cache.test' => 'test')); $container->register('request', 'Symfony\Component\HttpFoundation\Request'); $lock = $this->getMock('Drupal\Core\Lock\LockBackendInterface'); $cid = 2; @@ -78,6 +80,12 @@ public function testLocks() { ->method('get') ->with('status') ->will($this->returnValue((object) array('value' => NULL))); + $comment->expects($this->once()) + ->method('getCacheTag') + ->will($this->returnValue(array('comment' => array($cid)))); + $comment->expects($this->once()) + ->method('getListCacheTags') + ->will($this->returnValue(array('comments' => TRUE))); $storage_controller = $this->getMock('Drupal\comment\CommentStorageControllerInterface'); $comment->preSave($storage_controller); $comment->postSave($storage_controller); diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php index e3830ca..97ba84b 100644 --- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php @@ -338,7 +338,7 @@ public function testEnable() { public function testDisable() { $this->cacheBackend->expects($this->once()) ->method('invalidateTags') - ->with(array($this->entityTypeId => array($this->entityId))); + ->with(array($this->entityTypeId => array($this->id))); $this->entity->setStatus(TRUE); $this->assertSame($this->entity, $this->entity->disable()); diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php index 88e3202..7310f54 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php @@ -356,7 +356,7 @@ public function testPostDelete() { $entity->expects($this->once()) ->method('onSaveOrDelete'); - $entities = array($this->entityId => $entity); + $entities = array($this->values['id'] => $entity); $this->entity->postDelete($storage, $entities); }