Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit db58378

Browse files
committed
Fix test warnings due to usage of deprecated assertArraySubset()
Also changed app_id to strings where appropriate, in real apps they should be strings when read from environment, not ints.
1 parent e3c0cea commit db58378

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

tests/ConnectionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function successful_connections_have_the_app_attached()
4646
$this->pusherServer->onOpen($connection);
4747

4848
$this->assertInstanceOf(App::class, $connection->app);
49-
$this->assertSame(1234, $connection->app->id);
49+
$this->assertSame('1234', $connection->app->id);
5050
$this->assertSame('TestKey', $connection->app->key);
5151
$this->assertSame('TestSecret', $connection->app->secret);
5252
$this->assertSame('Test App', $connection->app->name);

tests/Statistics/Controllers/WebSocketsStatisticsControllerTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,20 @@ public function it_can_store_statistics()
2222

2323
$this->assertCount(1, $entries);
2424

25-
$this->assertArraySubset($this->payload(), $entries->first()->attributesToArray());
25+
$actual = $entries->first()->attributesToArray();
26+
foreach ($this->payload() as $key => $value) {
27+
$this->assertArrayHasKey($key, $actual);
28+
$this->assertSame($value, $actual[$key]);
29+
}
2630
}
2731

2832
protected function payload(): array
2933
{
3034
return [
3135
'app_id' => config('websockets.apps.0.id'),
32-
'peak_connection_count' => 1,
33-
'websocket_message_count' => 2,
34-
'api_message_count' => 3,
36+
'peak_connection_count' => '1',
37+
'websocket_message_count' => '2',
38+
'api_message_count' => '3',
3539
];
3640
}
3741
}

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected function getEnvironmentSetUp($app)
4646
$app['config']->set('websockets.apps', [
4747
[
4848
'name' => 'Test App',
49-
'id' => 1234,
49+
'id' => '1234',
5050
'key' => 'TestKey',
5151
'secret' => 'TestSecret',
5252
'host' => 'localhost',

0 commit comments

Comments
 (0)