JMAP-Tester
view release on metacpan or search on metacpan
lib/JMAP/Tester.pm view on Meta::CPAN
#pod
#pod This method fetches the content at the authentication endpoint and uses it to
#pod configure the tester's target URIs and signing keys.
#pod
#pod This method respects the C<should_return_futures> attributes of the
#pod JMAP::Tester object, and in futures mode will return a future that will resolve
#pod to the Result.
#pod
#pod =cut
sub update_client_session {
my ($self, $auth_uri) = @_;
my $future = $self->_get_client_session_future($auth_uri)->then(sub {
my ($auth) = @_;
$self->configure_from_client_session($auth->client_session);
return Future->done($auth);
});
lib/JMAP/Tester/Response/Sentence/Set.pm view on Meta::CPAN
}
sub created_creation_ids {
keys %{ $_[0]->created }
}
sub created_ids {
map {; $_->{id} } values %{ $_[0]->created }
}
sub updated_ids {
my ($self) = @_;
my $updated = $_[0]{arguments}{updated} // {};
if (ref $updated eq 'ARRAY') {
return @$updated;
}
return keys %$updated;
}
sub updated {
my ($self) = @_;
my $updated = $_[0]{arguments}{updated} // {};
if (ref $updated eq 'ARRAY') {
return { map {; $_ => undef } @$updated };
}
return $updated;
}
sub destroyed_ids { @{ $_[0]{arguments}{destroyed} } }
# Is this the best API to provide? I dunno, maybe. Usage will tell us whether
# it's right. -- rjbs, 2016-04-11
sub not_created_ids { keys %{ $_[0]{arguments}{notCreated} } }
sub not_updated_ids { keys %{ $_[0]{arguments}{notUpdated} } }
sub not_destroyed_ids { keys %{ $_[0]{arguments}{notDestroyed} } }
sub create_errors { $_[0]{arguments}{notCreated} // {} }
sub update_errors { $_[0]{arguments}{notUpdated} // {} }
sub destroy_errors { $_[0]{arguments}{notDestroyed} // {} }
sub assert_no_errors {
my ($self) = @_;
my @errors;
local $Data::Dumper::Terse = 1;
if (keys %{ $self->create_errors }) {
push @errors, "notCreated: " . Data::Dumper::Dumper(
( run in 0.746 second using v1.01-cache-2.11-cpan-ddb90ed6d15 )