Esempio n. 1
0
 public function testProcessParams()
 {
     $client = new Client('https://*****:*****@app.getsentry.com/789');
     $data = array('foo' => 'bar');
     $message = Raven_Compat::json_encode($data);
     if (function_exists("gzcompress")) {
         $message = base64_encode(gzcompress($message));
     }
     $handler = m::mock('rcrowe\\Raven\\Handler\\HandlerInterface');
     $handler->shouldReceive('process')->once()->with('https://app.getsentry.com/api/store/', $message, m::on(function ($param) {
         if (!array_key_exists('User-Agent', $param)) {
             return false;
         }
         if ($param['User-Agent'] !== 'rcrowe-raven/' . Client::VERSION) {
             return false;
         }
         if (!array_key_exists('X-Sentry-Auth', $param)) {
             return false;
         }
         if (!array_key_exists('Content-Type', $param)) {
             return false;
         }
         if ($param['Content-Type'] !== 'application/octet-stream') {
             return false;
         }
         return true;
     }));
     $client->setHandler($handler);
     $client->send($data);
 }