1<?php
2
3namespace Sabre\HTTP;
4
5class ResponseDecoratorTest extends \PHPUnit_Framework_TestCase {
6
7    protected $inner;
8    protected $outer;
9
10    function setUp() {
11
12        $this->inner = new Response();
13        $this->outer = new ResponseDecorator($this->inner);
14
15    }
16
17    function testStatus() {
18
19        $this->outer->setStatus(201);
20        $this->assertEquals(201, $this->inner->getStatus());
21        $this->assertEquals(201, $this->outer->getStatus());
22        $this->assertEquals('Created', $this->inner->getStatusText());
23        $this->assertEquals('Created', $this->outer->getStatusText());
24
25    }
26
27    function testToString() {
28
29        $this->inner->setStatus(201);
30        $this->inner->setBody('foo');
31        $this->inner->setHeader('foo', 'bar');
32
33        $this->assertEquals((string)$this->inner, (string)$this->outer);
34
35    }
36
37}
38