-
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathEnvelopeTest.php
More file actions
26 lines (20 loc) · 748 Bytes
/
EnvelopeTest.php
File metadata and controls
26 lines (20 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
declare(strict_types=1);
namespace Yiisoft\Queue\Tests\Unit\Message;
use PHPUnit\Framework\TestCase;
use Yiisoft\Queue\Tests\App\DummyEnvelope;
final class EnvelopeTest extends TestCase
{
public function testFromData(): void
{
$type = 'test-handler';
$data = ['key' => 'value'];
$metadata = ['meta' => 'data'];
$envelope = DummyEnvelope::fromData($type, $data, $metadata);
$this->assertInstanceOf(DummyEnvelope::class, $envelope);
$this->assertSame($type, $envelope->getType());
$this->assertSame($data, $envelope->getData());
$this->assertArrayHasKey('meta', $envelope->getMetadata());
$this->assertSame('data', $envelope->getMetadata()['meta']);
}
}