Exemple #1
0
 public function headersContains($keyword)
 {
     $request = Castle_RequestTransport::getLastRequest();
     if (!empty($request)) {
         return array_key_exists($keyword, $request['headers']);
     }
     return false;
 }
Exemple #2
0
 public function assertRequest($method, $url, $headers = null)
 {
     $request = Castle_RequestTransport::getLastRequest();
     $this->assertEquals($method, $request['method']);
     $this->assertEquals(Castle_Request::apiUrl($url), $request['url']);
     if (is_array($headers)) {
         foreach ($headers as $key => $value) {
             $this->assertArrayHasKey($key, $request['headers']);
             $this->assertEquals($request['headers'][$key], $value);
         }
     }
     return $request;
 }
Exemple #3
0
 public function testEscapeUrl()
 {
     $user = new TestUser('Hofbräuhaus / München');
     $user->fetch();
     $request = Castle_RequestTransport::getLastRequest();
     $this->assertStringEndsWith('Hofbr%C3%A4uhaus%20%2F%20M%C3%BCnchen', $request['url']);
 }