Code Duplication    Length = 29-31 lines in 2 locations

test/PsrSqlLoggerTest.php 1 location

@@ 99-127 (lines=29) @@
96
        self::assertInternalType('float', $log->context->get('duration_μs'));
97
    }
98
99
    public function testSharedQueryId()
100
    {
101
        self::assertCount(0, $this->logger->log);
102
103
        $this->sut->startQuery(
104
            $this->sql,
105
            [
106
                ':id' => 1234,
107
            ],
108
            [
109
                ':id' => \PDO::PARAM_INT,
110
            ]
111
        );
112
113
        $this->sut->stopQuery();
114
115
        self::assertCount(2, $this->logger->log);
116
117
        $startLog = $this->getRecordByIndex(0);
118
119
        self::assertInstanceOf(Record::class, $startLog);
120
121
        $queryId = $startLog->context->get('query_id');
122
        self::assertNotEmpty($queryId);
123
124
        $stopLog = $this->getRecordByIndex(1);
125
126
        self::assertSame($queryId, $stopLog->context->get('query_id'));
127
    }
128
129
    public function testQueryIdChanges()
130
    {

test/PsrSqlParamsLoggerTest.php 1 location

@@ 102-132 (lines=31) @@
99
        self::assertInternalType('float', $log->context->get('duration_μs'));
100
    }
101
102
    public function testSharedQueryId()
103
    {
104
        self::assertCount(0, $this->logger->log);
105
106
        $this->sut->startQuery(
107
            $this->sql,
108
            [
109
                ':id' => 1234,
110
            ],
111
            [
112
                ':id' => \PDO::PARAM_INT,
113
            ]
114
        );
115
116
        $this->sut->stopQuery();
117
118
        self::assertCount(2, $this->logger->log);
119
120
        $startLog = $this->getRecordByIndex(0);
121
122
        self::assertInstanceOf(Record::class, $startLog);
123
124
        $queryId = $startLog->context->get('query_id');
125
        self::assertNotEmpty($queryId);
126
127
128
        $stopLog = $this->getRecordByIndex(1);
129
130
        self::assertInstanceOf(Record::class, $stopLog);
131
        self::assertSame($queryId, $stopLog->context->get('query_id'));
132
    }
133
134
    public function testQueryIdChanges()
135
    {