Skip to content

Commit 3618cae

Browse files
Fix deprecation on tests, fix incomplete test, fix PHPUnit compat
1 parent c7ad483 commit 3618cae

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/Checker/JsonSorter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function recursiveAlphabeticalSort($item)
3838

3939
if ('parameters' === $key) {
4040
usort($asArray['parameters'], function ($a, $b) {
41-
return isset($a['name']) && isset($b['name']) && $a['name'] > $b['name'];
41+
return (isset($a['name']) && isset($b['name']) && $a['name'] > $b['name']) ? 1 : 0;
4242
});
4343
}
4444
}

tests/ReadingTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ public function testItCanSearchMessages()
124124
]);
125125

126126
self::assertInstanceOf(SearchMessagesGetResponse200::class, $results);
127-
128-
self::markTestIncomplete('The response is not tested as it is not specified!');
127+
self::assertTrue($results->getOk());
129128
}
130129
}

tests/WritingTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ public function testItCanPostAttachment()
3636
]);
3737

3838
self::assertInstanceOf(ChatPostMessagePostResponse200::class, $response);
39-
self::assertStringContainsString($response->getMessage()->getAttachments()[0]->getImageUrl(), 'https://jolicode.com/images/valeurs_huma.png');
39+
40+
if (method_exists($this, 'assertStringContainsString')) {
41+
self::assertStringContainsString($response->getMessage()->getAttachments()[0]->getImageUrl(), 'https://jolicode.com/images/valeurs_huma.png');
42+
} else {
43+
self::assertContains($response->getMessage()->getAttachments()[0]->getImageUrl(), 'https://jolicode.com/images/valeurs_huma.png');
44+
}
4045
}
4146

4247
public function testItCanPostMessageWithBlock()

0 commit comments

Comments
 (0)