| 1 | <?php |
||
| 7 | class PayloadSpec extends ObjectBehavior |
||
| 8 | { |
||
| 9 | function let() |
||
| 10 | { |
||
| 11 | $this->beConstructedWith('status'); |
||
| 12 | } |
||
| 13 | |||
| 14 | public function getMatchers() |
||
| 15 | { |
||
| 16 | return [ |
||
| 17 | 'beEmpty' => function ($subject) { |
||
| 18 | return empty($subject); |
||
| 19 | }, |
||
| 20 | ]; |
||
| 21 | } |
||
| 22 | |||
| 23 | function it_has_immutable_input() |
||
| 24 | { |
||
| 25 | $payload = $this->withInput(['input']); |
||
| 26 | $payload->getInput()->shouldContain('input'); |
||
| 27 | $this->getInput()->shouldBeEmpty(); |
||
| 28 | } |
||
| 29 | |||
| 30 | function it_has_immutable_output() |
||
| 31 | { |
||
| 32 | $payload = $this->withOutput('output'); |
||
| 33 | $payload->getOutput()->shouldBe('output'); |
||
| 34 | $this->getInput()->shouldBeEmpty(); |
||
| 35 | } |
||
| 36 | |||
| 37 | function it_has_status() |
||
| 38 | { |
||
| 39 | $this->getStatus()->shouldBe('status'); |
||
| 40 | } |
||
| 41 | |||
| 42 | function it_is_initializable() |
||
| 43 | { |
||
| 44 | $this->shouldImplement(\Venta\Contracts\Adr\Payload::class); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |