Passed
Push — master ( 7bc374...cf39f3 )
by Arthur
05:05
created

BroadcastTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: arthur
5
 * Date: 14.10.18
6
 * Time: 22:56.
7
 */
8
9
namespace Foundation\Tests;
10
11
use Foundation\Abstracts\Tests\HttpTest;
12
use MongoDB\BSON\ObjectId;
13
14
//Tests disabled because need a way to enable pusher without sending messages to test.
15
/*
16
class BroadcastTest extends HttpTest
17
{
18
19
    public function testPrivateChannelAuthenticationSuccess()
20
    {
21
        $user = $this->getHttpUser();
22
        $id = $user->getKey();
23
        $response = $this->http('POST', '/broadcasting/auth', [
24
            'socket_id' => '125200.2991064',
25
            'channel_name' => 'private-user.' . $id
26
        ]);
27
        //$response->assertStatus(200);
28
        $response = $this->decodeHttpContent($response->content(), false);
29
        $this->assertArrayHasKey('auth', $response);
30
    }
31
32
    public function testPrivateChannelAuthenticationForbidden()
33
    {
34
        $response = $this->http('POST', '/broadcasting/auth', [
35
            'socket_id' => '125200.2991064',
36
            'channel_name' => 'private-user.' . new ObjectId()
37
        ]);
38
        $response->assertStatus(403);
39
    }
40
41
}*/
42