Skip to content

Commit 6eafec3

Browse files
authored
Adapt to yiisoft/yii-debug summary (#100)
* Adapt to yiisoft/yii-debug summary * Add changelog * Fix tests
1 parent ddb536c commit 6eafec3

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- New #97: Add HTTP cookie authentication method (@IbragimovDiyorbek)
77
- Chg #95, #99: Change PHP constraint in `composer.json` to `8.0 - 8.4` (@vjik)
88
- Bug #99: Explicitly mark nullable parameters (@vjik)
9+
- Eng #100: Adapt summary data in debug collector (@rustamwin)
910

1011
## 3.1.1 May 06, 2024
1112

src/Debug/IdentityCollector.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,8 @@ public function getSummary(): array
5050
}
5151
$lastIdentity = end($this->identities);
5252
return [
53-
'identity' => [
54-
'lastId' => is_array($lastIdentity) ? $lastIdentity['id'] : null,
55-
'total' => count($this->identities),
56-
],
53+
'lastId' => is_array($lastIdentity) ? $lastIdentity['id'] : null,
54+
'total' => count($this->identities),
5755
];
5856
}
5957
}

tests/Debug/UserCollectorTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ protected function checkSummaryData(array $data): void
4444
{
4545
parent::checkSummaryData($data);
4646

47-
$this->assertArrayHasKey('identity', $data);
48-
$this->assertArrayHasKey('lastId', $data['identity']);
49-
$this->assertEquals('stub2', $data['identity']['lastId']);
50-
$this->assertEquals(2, $data['identity']['total']);
47+
$this->assertArrayHasKey('lastId', $data);
48+
$this->assertEquals('stub2', $data['lastId']);
49+
$this->assertEquals(2, $data['total']);
5150
}
5251
}

0 commit comments

Comments
 (0)