3 class HeaderTest
extends PHPUnit_Framework_TestCase
{
5 $this->h
= new http\
Header("foo", "bar");
7 function testString() {
8 $this->assertEquals("Foo: bar", (string) $this->h
);
11 function testSerialize() {
12 $this->assertEquals("Foo: bar", (string) unserialize(serialize($this->h
)));
15 function testMatch() {
16 $ae = new http\
Header("Accept-encoding", "gzip, deflate");
17 $this->assertTrue($ae->match("gzip", http\Header
::MATCH_WORD
));
18 $this->assertTrue($ae->match("gzip", http\Header
::MATCH_WORD|http\Header
::MATCH_CASE
));
19 $this->assertFalse($ae->match("gzip", http\Header
::MATCH_STRICT
));
20 $this->assertTrue($ae->match("deflate", http\Header
::MATCH_WORD
));
21 $this->assertTrue($ae->match("deflate", http\Header
::MATCH_WORD|http\Header
::MATCH_CASE
));
22 $this->assertFalse($ae->match("deflate", http\Header
::MATCH_STRICT
));
24 $this->assertFalse($ae->match("zip", http\Header
::MATCH_WORD
));
25 $this->assertFalse($ae->match("gzip", http\Header
::MATCH_FULL
));