Cookies-Roundtrip

 view release on metacpan or  search on metacpan

t/360-file-cookier.t.doesnotwork  view on Meta::CPAN

	   'SetCookies-array',
	   'useragent-string'
){
	ok(exists $perlobj->{$k}, "Cookier output file '$cookiesjsonfilename' contains key '$k'.") or BAIL_OUT;
	ok(defined $perlobj->{$k}, "Cookier output file '$cookiesjsonfilename' contains key '$k' and it has a defined value.") or BAIL_OUT;
}

# Check the objects (they are encoded in base64)
my $rr = 'HTTP::Cookies';
my $objb64 = MIME::Base64::decode_base64($perlobj->{$rr.'-object'});
ok(defined $objb64, "'$rr-object' has been decoded from Base64.") or BAIL_OUT($perlobj->{'$rr-object'}."\nno, see above the alledged base64 string.");
my $httpcookies_obj = eval { Storable::thaw($objb64) };
ok(!$@, "'$rr-object' has been thaw'ed via eval successfully.") or BAIL_OUT("no: $@");
ok(defined $httpcookies_obj, "'$rr-object' has been thaw'ed.") or BAIL_OUT;
is(ref($httpcookies_obj), $rr, "'$rr-object' has the correct type ($rr).") or BAIL_OUT("no, it is of type '".ref($httpcookies_obj)."'.");
$cookies_obj{'httpcookies_obj'} = $httpcookies_obj;

$rr = 'SetCookies-array';
my $setcookies_obj = $perlobj->{$rr};
is(ref($setcookies_obj), 'ARRAY', "'$rr-object' has the correct type ($rr).") or BAIL_OUT("no, it is of type '".ref($setcookies_obj)."'.");
for (@$setcookies_obj){
	is(ref($_), '', "'$rr-object' is an array and its item(s) has the correct type ('Firefox::Marionette::Cookie').") or BAIL_OUT("no, it is of type '".ref($_)."'.");
}
$cookies_obj{'setcookies_obj'} = setcookies2httpcookies($setcookies_obj, undef, $VERBOSITY);

#die as_string_cookies($cookies_obj{'setcookies_obj'});

$rr = 'Firefox::Marionette::Cookie-array';
$objb64 = MIME::Base64::decode_base64($perlobj->{$rr.'-object'});
ok(defined $objb64, "'$rr-object' has been decoded from Base64.") or BAIL_OUT($perlobj->{'$rr-object'}."\nno, see above the alledged base64 string.");
my $firefoxmarionettecookies_obj = eval { Storable::thaw($objb64) };
ok(!$@, "'$rr-object' has been thaw'ed via eval successfully.") or BAIL_OUT("no: $@");
is(ref($firefoxmarionettecookies_obj), 'ARRAY', "'$rr-object' has the correct type ($rr).") or BAIL_OUT("no, it is of type '".ref($firefoxmarionettecookies_obj)."'.");
for (@$firefoxmarionettecookies_obj){
	is(ref($_), 'Firefox::Marionette::Cookie', "'$rr-object' is an array and its item(s) has the correct type ('Firefox::Marionette::Cookie').") or BAIL_OUT("no, it is of type '".ref($_)."'.");
}
$cookies_obj{'firefoxmarionettecookies_obj'} = firefoxmarionettecookies2httpcookies($firefoxmarionettecookies_obj, undef, 0, $VERBOSITY);

print "XXXXXXXXX "
	." count setcookies_obj ".count_cookies($cookies_obj{'setcookies_obj'}, 0, 0)."\n"



( run in 1.779 second using v1.01-cache-2.11-cpan-bbb979687b5 )