Пример #1
0
 public function testSendIterable()
 {
     $this->markTestIncomplete('To rewrite');
     $iter = array('a', 'b');
     $socket = new DummyZMQSocket();
     $socket->setNextRecv(file_get_contents(__DIR__ . '/../data/example.payload'));
     $conn = new mongrel2\Connection($socket, $socket);
     $mess = $conn->recv();
     $res = new http\Response($iter);
     $res->sendIterable($mess, $conn);
     $res->sendIterable($mess, $conn, false);
 }
Пример #2
0
 /**
  * Artificial big headers in a message to test the parser.
  */
 public function testBigHeaders()
 {
     $this->markTestIncomplete('To rewrite');
     $headers = array('METHOD' => 'JSON');
     for ($i = 1; $i <= 100; $i++) {
         $headers['X-Dummy-' . $i] = str_repeat(chr($i % 26 + 64), 100);
     }
     $headers = json_encode($headers);
     $msg = sprintf('34f9ceee-cd52-4b7f-b197-88bf2f0ec378 6 /handlertest/foo %d:%s,%d:%s,', strlen($headers), $headers, 7, '"HELLO"');
     $socket = new DummyZMQSocket();
     $socket->setNextRecv($msg);
     $conn = new mongrel2\Connection($socket, null);
     $mess = $conn->recv();
     $this->assertEquals($mess->path, '/handlertest/foo');
     $this->assertEquals($mess->body, 'HELLO');
 }