Test to verify addEmailAddress returns a valid id.
This commit is contained in:
parent
5b07fe6af9
commit
9e2359ed72
2 changed files with 8 additions and 3 deletions
Supporters
|
@ -168,6 +168,8 @@ Arguments:
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
|
Returns the id value of the email_address entry.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub addEmailAddress($$$$) {
|
sub addEmailAddress($$$$) {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
use Test::More tests => 21;
|
use Test::More tests => 23;
|
||||||
use Test::Exception;
|
use Test::Exception;
|
||||||
|
|
||||||
use Scalar::Util qw(looks_like_number);
|
use Scalar::Util qw(looks_like_number);
|
||||||
|
@ -79,8 +79,11 @@ dies_ok { $sp->addEmailAddress(undef, 'drapper@example.org', 'paypal'); }
|
||||||
dies_ok { $sp->addEmailAddress("String", 'drapper@example.org', 'paypal'); }
|
dies_ok { $sp->addEmailAddress("String", 'drapper@example.org', 'paypal'); }
|
||||||
"addEmailAddress: dies for non-numeric id";
|
"addEmailAddress: dies for non-numeric id";
|
||||||
|
|
||||||
ok($sp->addEmailAddress($drapperId, 'drapper@example.org', 'work'),
|
my $drapperEmailId;
|
||||||
"addEmailAddress: simple add test");
|
|
||||||
|
lives_ok { $drapperEmailId = $sp->addEmailAddress($drapperId, 'drapper@example.org', 'work') }
|
||||||
|
"addEmailAdress: inserting a valid email address works";
|
||||||
|
ok((looks_like_number($drapperEmailId) and $drapperEmailId > 0), "addEmailAddress: id returned is sane.");
|
||||||
|
|
||||||
=item addAddressType
|
=item addAddressType
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue