Bugzilla – Attachment 85313 Details for
Bug 21692
Koha::Account->new has no tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21692: (QA follow-up) Enhance test for new
Bug-21692-QA-follow-up-Enhance-test-for-new.patch (text/plain), 1.87 KB, created by
Martin Renvoize (ashimema)
on 2019-02-19 20:01:00 UTC
(
hide
)
Description:
Bug 21692: (QA follow-up) Enhance test for new
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-02-19 20:01:00 UTC
Size:
1.87 KB
patch
obsolete
>From 0358d82f961fed45640d4f2d349d70c02c983e41 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 19 Feb 2019 19:34:04 +0000 >Subject: [PATCH] Bug 21692: (QA follow-up) Enhance test for new > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Koha/Account.t | 20 +++++++++++++++++--- > 1 file changed, 17 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Koha/Account.t b/t/db_dependent/Koha/Account.t >index 27d5756477..1ccf716437 100755 >--- a/t/db_dependent/Koha/Account.t >+++ b/t/db_dependent/Koha/Account.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 7; >+use Test::More tests => 8; > use Test::MockModule; > use Test::Exception; > >@@ -34,6 +34,21 @@ use t::lib::TestBuilder; > my $schema = Koha::Database->new->schema; > my $builder = t::lib::TestBuilder->new; > >+subtest 'new' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ throws_ok { Koha::Account->new(); } qr/No patron id passed in!/, 'Croaked on bad call to new'; >+ >+ my $patron = $builder->build_object({ class => 'Koha::Patrons' }); >+ my $account = Koha::Account->new( { patron_id => $patron->borrowernumber } ); >+ is( defined $account, 1, "Account is defined" ); >+ >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'outstanding_debits() tests' => sub { > > plan tests => 22; >@@ -141,7 +156,7 @@ subtest 'outstanding_credits() tests' => sub { > > subtest 'add_credit() tests' => sub { > >- plan tests => 16; >+ plan tests => 15; > > $schema->storage->txn_begin; > >@@ -151,7 +166,6 @@ subtest 'add_credit() tests' => sub { > > my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); > my $account = Koha::Account->new( { patron_id => $patron->borrowernumber } ); >- is( defined $account, 1, "Account is defined" ); > > is( $account->balance, 0, 'Patron has no balance' ); > >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21692
:
84121
|
84154
|
85221
|
85311
|
85312
| 85313