Bugzilla – Attachment 134287 Details for
Bug 30553
Add a count to the Files tab in the patron account
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30553: Unit tests
Bug-30553-Unit-tests.patch (text/plain), 1.69 KB, created by
Lucas Gass
on 2022-04-28 17:54:45 UTC
(
hide
)
Description:
Bug 30553: Unit tests
Filename:
MIME Type:
Creator:
Lucas Gass
Created:
2022-04-28 17:54:45 UTC
Size:
1.69 KB
patch
obsolete
>From 12159698265e71178c1ec97e613f8dc989bd653f Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 28 Apr 2022 17:54:11 +0000 >Subject: [PATCH] Bug 30553: Unit tests > >--- > t/db_dependent/Koha/Patron.t | 26 +++++++++++++++++++++++++- > 1 file changed, 25 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Patron.t b/t/db_dependent/Koha/Patron.t >index 6418d6066f..a4a26f76b2 100755 >--- a/t/db_dependent/Koha/Patron.t >+++ b/t/db_dependent/Koha/Patron.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 16; >+use Test::More tests => 17; > use Test::Exception; > use Test::Warn; > >@@ -29,6 +29,7 @@ use Koha::DateUtils qw(dt_from_string); > use Koha::ArticleRequests; > use Koha::Patrons; > use Koha::Patron::Relationships; >+use Koha::Patron::Files; > > use t::lib::TestBuilder; > use t::lib::Mocks; >@@ -1137,3 +1138,26 @@ subtest 'recalls() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'filecount() tests' => sub { >+ >+ plan tests => 3; >+ >+ $schema->storage->txn_begin; >+ >+ t::lib::Mocks::mock_preference( 'EnableBorrowerFiles', 1 ); >+ >+ my $patron_1 = $builder->build_object({ class => 'Koha::Patrons' }); >+ >+ is($patron_1->filecount, 0 , "Patron has 0 files"); >+ >+ my $bf = Koha::Patron::Files->new( borrowernumber => $patron_1->id ); >+ $bf->AddFile( name => 'name1', type => 'type1', >+ description => '', content => 'content1' ); >+ is($patron_1->filecount, 1 , "Patron has 1 files"); >+ $bf->AddFile( name => 'name2', type => 'type2', >+ description => '', content => 'content2' ); >+ is($patron_1->filecount, 2 , "Patron has many files"); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.30.2
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 30553
:
133365
|
133480
|
133847
| 134287