Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit 1b53b88

Browse files
committed
Tests for Message class
1 parent b3ab1cf commit 1b53b88

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

spec/Nats/MessageSpec.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
namespace spec\Nats;
3+
4+
use Nats\Connection;
5+
6+
use PhpSpec\ObjectBehavior;
7+
8+
class MessageSpec extends ObjectBehavior
9+
{
10+
function let()
11+
{
12+
$conn = new Connection();
13+
14+
$this->beConstructedWith('subject', 'body', 'sid', $conn);
15+
}
16+
17+
function it_is_initializable()
18+
{
19+
$this->shouldHaveType('Nats\Message');
20+
}
21+
22+
function it_has_a_subject()
23+
{
24+
$this->getSubject()->shouldBe('subject');
25+
}
26+
27+
function it_has_a_body()
28+
{
29+
$this->getBody()->shouldBe('body');
30+
}
31+
32+
function it_has_a_sid()
33+
{
34+
$this->getSid()->shouldBe('sid');
35+
}
36+
37+
function it_has_connection()
38+
{
39+
$this->getConn()->shouldHaveType('Nats\Connection');
40+
}
41+
}

0 commit comments

Comments
 (0)