writeLogs example

static::assertNotNull($task);
        static::assertSame(LogCleanupTask::getDefaultInterval()$task->getRunInterval());
    }

    /** * @param list<string> $expectedMessages */
    private function runWithOptions(int $age, int $maxEntries, array $expectedMessages): void
    {
        $this->systemConfigService->set('core.logging.entryLifetimeSeconds', $age);
        $this->systemConfigService->set('core.logging.entryLimit', $maxEntries);
        $this->writeLogs();

        $handler = new LogCleanupTaskHandler(
            $this->scheduledTaskRepository,
            $this->systemConfigService,
            $this->connection
        );

        $handler->run();

        $results = $this->logEntryRepository->search(new Criteria()$this->context);
        static::assertEquals(\count($expectedMessages)$results->getTotal());

        
Home | Imprint | This part of the site doesn't use cookies.