ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Sabre\HTTP\ResponseTest Class Reference
+ Inheritance diagram for Sabre\HTTP\ResponseTest:
+ Collaboration diagram for Sabre\HTTP\ResponseTest:

Public Member Functions

 testConstruct ()
 
 testSetStatus ()
 
 testInvalidStatus ()
 InvalidArgumentException More...
 
 testToString ()
 

Detailed Description

Definition at line 5 of file ResponseTest.php.

Member Function Documentation

◆ testConstruct()

Sabre\HTTP\ResponseTest::testConstruct ( )

Definition at line 7 of file ResponseTest.php.

References $response.

7  {
8 
9  $response = new Response(200, ['Content-Type' => 'text/xml']);
10  $this->assertEquals(200, $response->getStatus());
11  $this->assertEquals('OK', $response->getStatusText());
12 
13  }
$response

◆ testInvalidStatus()

Sabre\HTTP\ResponseTest::testInvalidStatus ( )

InvalidArgumentException

Definition at line 27 of file ResponseTest.php.

References $response.

27  {
28 
29  $response = new Response(1000);
30 
31  }
$response

◆ testSetStatus()

Sabre\HTTP\ResponseTest::testSetStatus ( )

Definition at line 15 of file ResponseTest.php.

References $response.

15  {
16 
17  $response = new Response();
18  $response->setStatus('402 Where\'s my money?');
19  $this->assertEquals(402, $response->getStatus());
20  $this->assertEquals('Where\'s my money?', $response->getStatusText());
21 
22  }
$response

◆ testToString()

Sabre\HTTP\ResponseTest::testToString ( )

Definition at line 33 of file ResponseTest.php.

References $response.

33  {
34 
35  $response = new Response(200, ['Content-Type' => 'text/xml']);
36  $response->setBody('foo');
37 
38  $expected = <<<HI
39 HTTP/1.1 200 OK\r
40 Content-Type: text/xml\r
41 \r
42 foo
43 HI;
44  $this->assertEquals($expected, (string)$response);
45 
46  }
$response

The documentation for this class was generated from the following file: