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