Пример #1
0
 public function testPing()
 {
     try {
         $request = BackgroundUtil::get('/ping');
         $response = $request->send();
         $this->assertLessThanOrEqual(5000, time() * 1000 - $response->body->pong);
     } catch (ConnectionErrorException $e) {
         $this->markTestSkipped('Background service is not started');
     }
 }
Пример #2
0
 public function send($type, array $to, $subject, $html)
 {
     $response = BackgroundUtil::post('/mail/send/' . $type)->body(['to' => $to, 'subject' => $subject, 'html' => $html], 'json')->send();
     $body = (array) $response->body;
     return $body;
 }