createMock(AdapterInterface::class); $connection->expects(self::once()) ->method('insertMultiple') ->with( 'esun_localetranslation_log', self::callback(static function (array $rows): bool { return $rows[0]['source_text'] === "Hello\nworld" && $rows[0]['translated_text'] === "Bonjour\nmonde" && $rows[0]['character_count'] === 11 && !str_contains($rows[0]['source_text'], 'display:none'); }) ); $resourceConnection = $this->createMock(ResourceConnection::class); $resourceConnection->method('getConnection')->willReturn($connection); $resourceConnection->method('getTableName')->willReturn('esun_localetranslation_log'); $logger = new TranslationLogger($resourceConnection, new TranslatableTextExtractor()); $logger->logSuccess( 'deepl', 'cms_page', 5, 0, 2, 'EN', 'FR', [ 'content' => [ 'value' => '
Hello world
', 'is_html' => true, ], ], [ 'content' => 'Bonjour monde
', ] ); } }