1 | <?php |
||
10 | class Message extends Utils\AbstractAssert |
||
11 | { |
||
12 | /** |
||
13 | * @var MessageInterface |
||
14 | */ |
||
15 | protected $message; |
||
16 | |||
17 | /** |
||
18 | * Constructor. |
||
19 | * |
||
20 | * @param MessageInterface $message |
||
21 | * @param AbstractAssert|null $previous |
||
22 | */ |
||
23 | public function __construct(MessageInterface $message, Utils\AbstractAssert $previous = null) |
||
28 | |||
29 | /** |
||
30 | * Asserts that a header exists. |
||
31 | * |
||
32 | * @param string $name |
||
33 | * @param string $message |
||
34 | * |
||
35 | * @return self |
||
36 | */ |
||
37 | public function hasHeader($name, $message = '') |
||
41 | |||
42 | /** |
||
43 | * Asserts that a header does not exists. |
||
44 | * |
||
45 | * @param string $name |
||
46 | * @param string $message |
||
47 | * |
||
48 | * @return self |
||
49 | */ |
||
50 | public function hasNotHeader($name, $message = '') |
||
54 | |||
55 | /** |
||
56 | * Asserts that a header has a specific value. |
||
57 | * |
||
58 | * @param string $name |
||
59 | * @param string $value |
||
60 | * @param string $message |
||
61 | * |
||
62 | * @return self |
||
63 | */ |
||
64 | public function header($name, $value, $message = '') |
||
68 | |||
69 | /** |
||
70 | * Asserts the protocol version of the message. |
||
71 | * |
||
72 | * @param string $version |
||
73 | * @param string $message |
||
74 | * |
||
75 | * @return self |
||
76 | */ |
||
77 | public function protocolVersion($version, $message = '') |
||
81 | |||
82 | /** |
||
83 | * Asserts the whole body. |
||
84 | * |
||
85 | * @param string|StreamInterface $body |
||
86 | * @param string $message |
||
87 | * |
||
88 | * @return self |
||
89 | */ |
||
90 | public function body($body, $message = '') |
||
94 | |||
95 | /** |
||
96 | * Creates a Body instance to execute assertions in the body. |
||
97 | * |
||
98 | * @return Stream |
||
99 | */ |
||
100 | public function assertBody() |
||
104 | } |
||
105 |