Skip to content

Commit 1c6c7d4

Browse files
committed
fix a test
1 parent 23d7a59 commit 1c6c7d4

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

tests/AdminTest.php

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,18 @@ public function testEngineStats()
4141
{
4242
$result = $this->adminHandler->getEngineStats();
4343
static::assertTrue(is_array($result));
44-
static::assertTrue(isset($result["cache.limit"]));
45-
static::assertTrue(isset($result["cache.allocated"]));
46-
static::assertTrue(isset($result["columnFamilies"]));
44+
45+
if (isCluster($this->connection)) {
46+
foreach ($result as $server => $entry) {
47+
static::assertTrue(isset($entry["cache.limit"]));
48+
static::assertTrue(isset($entry["cache.allocated"]));
49+
static::assertTrue(isset($entry["columnFamilies"]));
50+
}
51+
} else {
52+
static::assertTrue(isset($result["cache.limit"]));
53+
static::assertTrue(isset($result["cache.allocated"]));
54+
static::assertTrue(isset($result["columnFamilies"]));
55+
}
4756
}
4857

4958

@@ -96,11 +105,11 @@ public function testGetServerTime()
96105
public function testGetServerLogEntries()
97106
{
98107
$result = $this->adminHandler->getServerLogEntries();
99-
static::assertTrue(is_array($result), 'Should be an array');
108+
static::assertTrue(is_array($result['messages']), 'Should be an array');
100109

101-
foreach ($result as $entry) {
110+
foreach ($result['messages'] as $entry) {
102111
static::assertArrayHasKey('id', $entry);
103-
static::assertArrayHasKey('topc', $entry);
112+
static::assertArrayHasKey('topic', $entry);
104113
static::assertArrayHasKey('level', $entry);
105114
static::assertArrayHasKey('date', $entry);
106115
static::assertArrayHasKey('message', $entry);

0 commit comments

Comments
 (0)