Inheritance: extends SimpleExpectation
Ejemplo n.º 1
0
 /**
  *    Sets the field and value to compare against.
  *    @param string $unwanted   Case insenstive trimmed header name.
  *    @param string $message    Optiona message override. Can use %s as
  *                              a placeholder for the original message.
  */
 function __construct($unwanted, $message = '%s')
 {
     parent::__construct($unwanted, false, $message);
 }
Ejemplo n.º 2
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.º 3
0
 function testLocationHeaderSplitsCorrectly()
 {
     $expectation = new HttpHeaderExpectation('Location', 'http://here/');
     $this->assertIdentical($expectation->test('Location: http://here/'), true);
 }
Ejemplo n.º 4
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);
 }