Exemple #1
0
 public function test_getConnection()
 {
     $request = new Request();
     $connection = new MockConnection();
     $request->setConnection($connection);
     $this->assertEquals($connection, $request->getConnection());
 }
Exemple #2
0
 protected static function generateHanshakeResponse(Request $request)
 {
     $session = $request->getSession();
     $session->start();
     $response = new Response("{$request->getSession()->getId()}:60:60:" . implode(',', self::$validTransportID));
     $response->headers->set('Content-Type', 'text/plain');
     $response->headers->set('Access-Control-Allow-Origin', $request->headers->get('Origin'));
     $response->headers->set('Access-Control-Allow-Credentials', 'true');
     return $response;
 }