summaryrefslogtreecommitdiff
path: root/plugins/broadcast/root/tests/Broadcast/MessageTest.php
blob: dd9e1cc31fc8acf55e5a9b62500990a9214f9004 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php

/**
 * Spiral Framework.
 *
 * @license   MIT
 * @author    Anton Titov (Wolfy-J)
 */

declare(strict_types=1);

namespace Spiral\Broadcast\Tests;

use PHPUnit\Framework\TestCase;
use Spiral\Broadcast\Message;

class MessageTest extends TestCase
{
    public function testSerialize(): void
    {
        $m = new Message('topic', ['hello' => 'world']);
        $this->assertSame('{"topic":"topic","payload":{"hello":"world"}}', json_encode($m));
    }
}