test() public method

True if it matches a string value or an array value in any order.
public test ( mixed $compare ) : boolean
$compare mixed Raw header block to search.
return boolean True if header present.
Ejemplo n.º 1
0
 function testMultilineSearchWithPadding()
 {
     $expectation = new HttpHeaderExpectation('a', ' A ');
     $this->assertIdentical($expectation->test("aa:A\r\nb:B\r\nc:C"), false);
     $this->assertIdentical($expectation->test("aa:A\r\na:A\r\nb:B"), true);
 }
Ejemplo n.º 2
0
 function testLocationHeaderSplitsCorrectly()
 {
     $expectation = new HttpHeaderExpectation('Location', 'http://here/');
     $this->assertIdentical($expectation->test('Location: http://here/'), true);
 }
Ejemplo n.º 3
0
 function testCaseInsensitivePatternMatching()
 {
     $expectation = new HttpHeaderExpectation('a', new PatternExpectation('/A/i'));
     $this->assertIdentical($expectation->test('a: a'), true);
     $this->assertIdentical($expectation->test('a: B'), false);
     $this->assertIdentical($expectation->test(' a : A '), true);
     $this->assertIdentical($expectation->test(' a : BAB '), true);
     $this->assertIdentical($expectation->test(' a : bab '), true);
 }