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.
This commit is contained in:
parent
e3c0cea77c
commit
db5837831b
|
|
@ -46,7 +46,7 @@ class ConnectionTest extends TestCase
|
|||
$this->pusherServer->onOpen($connection);
|
||||
|
||||
$this->assertInstanceOf(App::class, $connection->app);
|
||||
$this->assertSame(1234, $connection->app->id);
|
||||
$this->assertSame('1234', $connection->app->id);
|
||||
$this->assertSame('TestKey', $connection->app->key);
|
||||
$this->assertSame('TestSecret', $connection->app->secret);
|
||||
$this->assertSame('Test App', $connection->app->name);
|
||||
|
|
|
|||
|
|
@ -22,16 +22,20 @@ class WebSocketsStatisticsControllerTest extends TestCase
|
|||
|
||||
$this->assertCount(1, $entries);
|
||||
|
||||
$this->assertArraySubset($this->payload(), $entries->first()->attributesToArray());
|
||||
$actual = $entries->first()->attributesToArray();
|
||||
foreach ($this->payload() as $key => $value) {
|
||||
$this->assertArrayHasKey($key, $actual);
|
||||
$this->assertSame($value, $actual[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
protected function payload(): array
|
||||
{
|
||||
return [
|
||||
'app_id' => config('websockets.apps.0.id'),
|
||||
'peak_connection_count' => 1,
|
||||
'websocket_message_count' => 2,
|
||||
'api_message_count' => 3,
|
||||
'peak_connection_count' => '1',
|
||||
'websocket_message_count' => '2',
|
||||
'api_message_count' => '3',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
|
|||
$app['config']->set('websockets.apps', [
|
||||
[
|
||||
'name' => 'Test App',
|
||||
'id' => 1234,
|
||||
'id' => '1234',
|
||||
'key' => 'TestKey',
|
||||
'secret' => 'TestSecret',
|
||||
'host' => 'localhost',
|
||||
|
|
|
|||
Loading…
Reference in New Issue