ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ResponseDecoratorTest.php
Go to the documentation of this file.
1<?php
2
3namespace Sabre\HTTP;
4
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}
An exception for terminatinating execution or to throw for unit testing.
This class represents a single HTTP response.
Definition: Response.php:12