Skip to content

Commit f70ec89

Browse files
committed
up
1 parent 2f50177 commit f70ec89

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

phpstan.neon.dist

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@ parameters:
33
paths:
44
- src
55
- tests
6-
ignoreErrors:
7-
- '#Cannot call method (.*) on mixed#'
8-
reportUnmatchedIgnoredErrors: true
6+
reportUnmatchedIgnoredErrors: false
97
tmpDir: .phpstan

tests/ApiGeneratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function testDelete(): void
5151
{
5252
$row = $this->api->create($this->table, ['name' => 'Charlie']);
5353
$deleted = $this->api->delete($this->table, $row['id']);
54-
$this->assertTrue($deleted);
54+
$this->assertTrue($deleted['success'] ?? false);
5555
}
5656

5757
public function testList(): void

tests/RequestLoggerTest.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,19 @@ public function testQuickRequestLogging(): void
169169

170170
public function testLogStatistics(): void
171171
{
172+
// Add some request entries to ensure total_requests > 0
173+
$this->logger->logRequest(
174+
['method' => 'GET', 'action' => 'list', 'table' => 'users'],
175+
['status_code' => 200, 'size' => 10],
176+
0.01
177+
);
178+
$this->logger->logQuickRequest('POST', 'create', 'products', 'user:seed');
179+
$this->logger->logRequest(
180+
['method' => 'GET', 'action' => 'read', 'table' => 'users'],
181+
['status_code' => 404, 'size' => 0],
182+
0.02
183+
);
184+
172185
// Create various log entries
173186
$this->logger->logAuth('jwt', true, 'user1');
174187
$this->logger->logAuth('basic', false, 'user2', 'Invalid');
@@ -177,7 +190,7 @@ public function testLogStatistics(): void
177190

178191
$stats = $this->logger->getStats();
179192

180-
// Total should include INFO, WARNING, and ERROR level logs
193+
// Total should count request entries
181194
$this->assertGreaterThanOrEqual(2, $stats['total_requests']);
182195
$this->assertGreaterThanOrEqual(1, $stats['errors']);
183196
$this->assertGreaterThanOrEqual(1, $stats['warnings']);

0 commit comments

Comments
 (0)