diff --git a/src/lib/Persistence/Cache/ObjectStateHandler.php b/src/lib/Persistence/Cache/ObjectStateHandler.php index 8fe709234a..20b68167f7 100644 --- a/src/lib/Persistence/Cache/ObjectStateHandler.php +++ b/src/lib/Persistence/Cache/ObjectStateHandler.php @@ -51,7 +51,7 @@ public function loadGroup($groupId) (int) $groupId, $this->cacheIdentifierGenerator->generateKey(self::STATE_GROUP_IDENTIFIER, [], true) . '-', function (int $groupId): Group { - $this->logger->logCall(__METHOD__, ['groupId' => (int) $groupId]); + $this->logger->logCall(__CLASS__ . '::loadGroup', ['groupId' => (int) $groupId]); return $this->persistenceHandler->objectStateHandler()->loadGroup($groupId); }, @@ -79,7 +79,7 @@ public function loadGroupByIdentifier($identifier) $identifier, $this->cacheIdentifierGenerator->generateKey(self::STATE_GROUP_IDENTIFIER, [], true) . '-', function (string $identifier): Group { - $this->logger->logCall(__METHOD__, ['groupId' => $identifier]); + $this->logger->logCall(__CLASS__ . '::loadGroupByIdentifier', ['groupId' => $identifier]); return $this->persistenceHandler->objectStateHandler()->loadGroupByIdentifier($identifier); }, @@ -106,7 +106,7 @@ public function loadAllGroups($offset = 0, $limit = -1) $stateGroups = $this->getListCacheValue( $this->cacheIdentifierGenerator->generateKey(self::STATE_GROUP_ALL_IDENTIFIER, [], true), function () use ($offset, $limit): array { - $this->logger->logCall(__METHOD__, ['offset' => (int) $offset, 'limit' => (int) $limit]); + $this->logger->logCall(__CLASS__ . '::loadAllGroups', ['offset' => (int) $offset, 'limit' => (int) $limit]); return $this->persistenceHandler->objectStateHandler()->loadAllGroups(0, -1); }, @@ -135,7 +135,7 @@ public function loadObjectStates($groupId) $groupId, $this->cacheIdentifierGenerator->generateKey(self::STATE_LIST_BY_GROUP_IDENTIFIER, [], true) . '-', function (int $groupId): array { - $this->logger->logCall(__METHOD__, ['groupId' => (int) $groupId]); + $this->logger->logCall(__CLASS__ . '::loadObjectStates', ['groupId' => (int) $groupId]); return $this->persistenceHandler->objectStateHandler()->loadObjectStates($groupId); }, @@ -210,7 +210,7 @@ public function load($stateId) (int) $stateId, $this->cacheIdentifierGenerator->generateKey(self::STATE_IDENTIFIER, [], true) . '-', function (int $stateId): ObjectState { - $this->logger->logCall(__METHOD__, ['stateId' => $stateId]); + $this->logger->logCall(__CLASS__ . '::load', ['stateId' => $stateId]); return $this->persistenceHandler->objectStateHandler()->load($stateId); }, @@ -239,7 +239,7 @@ public function loadByIdentifier($identifier, $groupId) $identifier, $this->cacheIdentifierGenerator->generateKey(self::STATE_ID_IDENTIFIER, [], true) . '-', function (string $identifier) use ($groupId): ObjectState { - $this->logger->logCall(__METHOD__, ['identifier' => $identifier, 'groupId' => (int) $groupId]); + $this->logger->logCall(__CLASS__ . '::loadByIdentifier', ['identifier' => $identifier, 'groupId' => (int) $groupId]); return $this->persistenceHandler->objectStateHandler()->loadByIdentifier($identifier, (int) $groupId); }, @@ -335,7 +335,7 @@ public function getContentState($contentId, $stateGroupId) (int) $stateGroupId, $this->cacheIdentifierGenerator->generateKey(self::STATE_BY_GROUP_IDENTIFIER, [], true) . '-', function (int $stateGroupId) use ($contentId): ObjectState { - $this->logger->logCall(__METHOD__, ['contentId' => (int) $contentId, 'stateGroupId' => $stateGroupId]); + $this->logger->logCall(__CLASS__ . '::getContentState', ['contentId' => (int) $contentId, 'stateGroupId' => $stateGroupId]); return $this->persistenceHandler->objectStateHandler()->getContentState((int) $contentId, $stateGroupId); }, diff --git a/tests/lib/Persistence/Cache/AbstractCacheHandlerTest.php b/tests/lib/Persistence/Cache/AbstractCacheHandlerTest.php index bab472ebc1..4bdd590fb6 100644 --- a/tests/lib/Persistence/Cache/AbstractCacheHandlerTest.php +++ b/tests/lib/Persistence/Cache/AbstractCacheHandlerTest.php @@ -219,7 +219,11 @@ final public function testLoadMethodsCacheMiss( $cacheItem = $this->getCacheItem($key, null); $handlerMethodName = $this->getHandlerMethodName(); - $this->loggerMock->expects($this->once())->method('logCall'); + $handler = $this->persistenceCacheHandler->$handlerMethodName(); + $this->loggerMock + ->expects(self::once()) + ->method('logCall') + ->with(get_class($handler) . '::' . $method, self::isType('array')); if ($tagGeneratingArguments) { $this->cacheIdentifierGeneratorMock @@ -281,7 +285,6 @@ final public function testLoadMethodsCacheMiss( ->method('save') ->with($cacheItem); - $handler = $this->persistenceCacheHandler->$handlerMethodName(); $return = call_user_func_array([$handler, $method], $arguments); $this->assertEquals($data, $return);