@@ -43,7 +43,6 @@ public function testGetHeaders()
43
43
$ message = $ message ->withAddedHeader ('content-type ' , 'text/plain ' );
44
44
$ headers = $ message ->getHeaders ();
45
45
46
- $ this ->assertCount (1 , $ headers );
47
46
$ this ->assertTrue (isset ($ headers ['content-type ' ]));
48
47
$ this ->assertCount (2 , $ headers ['content-type ' ]);
49
48
}
@@ -91,9 +90,9 @@ public function testGetHeaderLine()
91
90
92
91
$ message = $ this ->getMessage ()->withAddedHeader ('content-type ' , 'text/html ' );
93
92
$ message = $ message ->withAddedHeader ('content-type ' , 'text/plain ' );
94
- $ this ->assertEquals ( ' text/html, text/plain ' , $ message ->getHeaderLine ('content-type ' ));
95
- $ this ->assertEquals ( ' text/html, text/plain ' , $ message ->getHeaderLine ('Content-Type ' ));
96
- $ this ->assertEquals ( ' text/html, text/plain ' , $ message ->getHeaderLine ('CONTENT-TYPE ' ));
93
+ $ this ->assertRegExp ( ' | text/html, ? text/plain| ' , $ message ->getHeaderLine ('content-type ' ));
94
+ $ this ->assertRegExp ( ' | text/html, ? text/plain| ' , $ message ->getHeaderLine ('Content-Type ' ));
95
+ $ this ->assertRegExp ( ' | text/html, ? text/plain| ' , $ message ->getHeaderLine ('CONTENT-TYPE ' ));
97
96
98
97
$ this ->assertEquals ('' , $ message ->getHeaderLine ('Bar ' ));
99
98
}
@@ -128,8 +127,8 @@ public function testWithAddedHeader()
128
127
129
128
$ message = $ this ->getMessage ()->withAddedHeader ('content-type ' , 'text/html ' );
130
129
$ message = $ message ->withAddedHeader ('CONTENT-type ' , 'text/plain ' );
131
- $ this ->assertEquals ( ' text/html, text/plain ' , $ message ->getHeaderLine ('content-type ' ));
132
- $ this ->assertEquals ( ' text/html, text/plain ' , $ message ->getHeaderLine ('Content-Type ' ));
130
+ $ this ->assertRegExp ( ' | text/html, ? text/plain| ' , $ message ->getHeaderLine ('content-type ' ));
131
+ $ this ->assertRegExp ( ' | text/html, ? text/plain| ' , $ message ->getHeaderLine ('Content-Type ' ));
133
132
}
134
133
135
134
public function testWithoutHeader ()
@@ -141,17 +140,17 @@ public function testWithoutHeader()
141
140
}
142
141
143
142
$ message = $ this ->getMessage ()->withAddedHeader ('content-type ' , 'text/html ' );
144
- $ message = $ message ->withAddedHeader ('Age ' , 0 );
143
+ $ message = $ message ->withAddedHeader ('Age ' , ' 0 ' );
145
144
$ message = $ message ->withAddedHeader ('X-Foo ' , 'bar ' );
146
145
147
146
$ headers = $ message ->getHeaders ();
148
- $ this -> assertCount ( 3 , $ headers );
147
+ $ headerCount = count ( $ headers );
149
148
$ this ->assertTrue (isset ($ headers ['Age ' ]));
150
149
151
150
// Remove a header
152
151
$ message = $ message ->withoutHeader ('age ' );
153
152
$ headers = $ message ->getHeaders ();
154
- $ this ->assertCount (2 , $ headers );
153
+ $ this ->assertCount ($ headerCount - 1 , $ headers );
155
154
$ this ->assertFalse (isset ($ headers ['Age ' ]));
156
155
}
157
156
0 commit comments