2020-09-10 19:59:26 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace BeyondCode\LaravelWebSockets\Test;
|
|
|
|
|
|
2022-10-06 11:46:54 +00:00
|
|
|
use Pusher\Pusher;
|
2020-09-10 19:59:26 +00:00
|
|
|
|
|
|
|
|
class TriggerEventTest extends TestCase
|
|
|
|
|
{
|
|
|
|
|
public function test_invalid_signatures_can_not_fire_the_event()
|
|
|
|
|
{
|
2022-10-06 11:46:54 +00:00
|
|
|
$this->startServer();
|
2020-09-10 19:59:26 +00:00
|
|
|
|
|
|
|
|
$connection = new Mocks\Connection;
|
|
|
|
|
|
|
|
|
|
$requestPath = '/apps/1234/events';
|
|
|
|
|
|
2022-10-06 11:46:54 +00:00
|
|
|
$queryString = http_build_query(Pusher::build_auth_query_params(
|
2020-09-10 19:59:26 +00:00
|
|
|
'TestKey', 'InvalidSecret', 'GET', $requestPath
|
2022-10-06 11:46:54 +00:00
|
|
|
));
|
2020-09-10 19:59:26 +00:00
|
|
|
|
2022-10-06 11:46:54 +00:00
|
|
|
$response = $this->await($this->browser->get('http://localhost:4000'."{$requestPath}?{$queryString}"));
|
2020-09-10 19:59:26 +00:00
|
|
|
|
2022-10-06 11:46:54 +00:00
|
|
|
$this->assertSame(405, $response->getStatusCode());
|
|
|
|
|
$this->assertSame('', $response->getBody()->getContents());
|
2020-09-10 19:59:26 +00:00
|
|
|
}
|
|
|
|
|
}
|