19
19
TEST_FOR_CLASS(@"NSHTTPCookie", cookie,
20
20
"NSHTTPCookie +cookieWithProperties: returns an NSHTTPCookie");
22
dict = [NSDictionary dictionaryWithObjectsAndKeys:
23
@"myname", NSHTTPCookieName,
24
@"myvalue", NSHTTPCookieValue,
25
@"/mypath", NSHTTPCookiePath,
26
@".test.com", NSHTTPCookieDomain,
27
@"http://www.origin.org", NSHTTPCookieOriginURL,
28
@"0", NSHTTPCookieVersion,
29
@"FALSE", NSHTTPCookieDiscard,
30
@"FALSE", NSHTTPCookieSecure,
32
cookie = [NSHTTPCookie cookieWithProperties: dict];
33
TEST_FOR_CLASS(@"NSHTTPCookie", cookie,
34
"NSHTTPCookie +cookieWithProperties: works with all constants");
22
36
dict = [NSDictionary dictionaryWithObjectsAndKeys: @"myname", @"Name",
23
37
@"myvalue", @"Value", @".test.com", @"Domain", nil];
24
38
cookie = [NSHTTPCookie cookieWithProperties: dict];
25
39
PASS(cookie == nil, "cookie without path returns nil");
27
41
dict = [NSDictionary dictionaryWithObject:
28
@"S=calendar=R7tjDKqNB5L8YTZSvf29Bg;Expires=Wed, 09-Mar-2011 23:00:35 GMT"
42
@"S=calendar=R7tjDKqNB5L8YTZSvf29Bg;Expires=Wed, 09-Mar-2011 23:00:35 GMT"
29
43
forKey: @"Set-Cookie"];
31
45
url = [NSURL URLWithString: @"http://www.google.com/calendar/feeds/default/"];
41
55
"NSHTTPCookie returns proper domain");
43
57
dict = [NSHTTPCookie requestHeaderFieldsWithCookies: cookies];
44
PASS([[dict objectForKey: @"Cookie"] isEqual: @"S=calendar=R7tjDKqNB5L8YTZSvf29Bg"],
45
"NSHTTPCookie can generate proper cookie");
58
PASS_EQUAL([dict objectForKey: @"Cookie"],
59
@"S=calendar=R7tjDKqNB5L8YTZSvf29Bg",
60
"NSHTTPCookie can generate proper cookie");
47
62
[arp release]; arp = nil;