Skip to content

Commit 51a8479

Browse files
Fixes for failing tests
1 parent b353dd6 commit 51a8479

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

examples/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ function presence($pubnub, $presence)
215215
// snippet.init_read_only
216216
$pnConfiguration = new PNConfiguration();
217217

218+
$pnConfiguration->setUserId("myUniqueUserId");
218219
$pnConfiguration->setSubscribeKey("my_sub_key");
219220

220221
$pubnub = new PubNub($pnConfiguration);

examples/MessageActions.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,18 +493,18 @@ function tagForAnalytics($pubnub, $channel, $messageTimetoken, $tag, $value)
493493
echo "\n=== MESSAGE ACTIONS DEMO COMPLETE ===\n";
494494

495495
// snippet.fetch_messages_with_paging
496-
function getMessageActionsWithPaging($channel, $start, $callback)
496+
function getMessageActionsWithPaging($pubnub, $channel, $start, $callback)
497497
{
498-
global $pubnub;
499498
$pubnub->getMessageActions([
500499
'channel' => $channel,
501500
'page' => [
502501
'limit' => 5,
503502
'start' => $start
504503
]
505-
])->then(function ($result) use ($channel, $callback) {
504+
])->then(function ($result) use ($pubnub, $channel, $callback) {
506505
if (!empty($result->actions)) {
507506
getMessageActionsWithPaging(
507+
$pubnub,
508508
$channel,
509509
$result->actions[0]->actionTimetoken,
510510
$callback
@@ -517,7 +517,7 @@ function getMessageActionsWithPaging($channel, $start, $callback)
517517
});
518518
}
519519

520-
getMessageActionsWithPaging('my_channel', microtime(true) * 10000, function ($actions) {
520+
getMessageActionsWithPaging($pubnub, 'my_channel', microtime(true) * 10000, function ($actions) {
521521
foreach ($actions as $action) {
522522
echo $action->type . "\n";
523523
echo $action->value . "\n";

examples/Snippets.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110

111111
// snippet.set_state_channel_group
112112
$pubnub->setState()
113-
->channelGroups(["gr1", "gr2", "gr3"])
113+
->channelGroups(["cg1", "cg2", "cg3"])
114114
->state(["age" => 30])
115115
->sync();
116116
// snippet.end

0 commit comments

Comments
 (0)