Bugzilla – Attachment 97561 Details for
Bug 24435
Add Koha::Biblio->items_count
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24435: Unit tests
Bug-24435-Unit-tests.patch (text/plain), 1.54 KB, created by
Nick Clemens (kidclamp)
on 2020-01-17 20:11:39 UTC
(
hide
)
Description:
Bug 24435: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-01-17 20:11:39 UTC
Size:
1.54 KB
patch
obsolete
>From ce2bfbe166022d240c4b3aeee5ab1d9e4b9f0095 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 16 Jan 2020 13:32:04 -0300 >Subject: [PATCH] Bug 24435: Unit tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/Koha/Biblio.t | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t >index 91017eeaae..4ce758a727 100644 >--- a/t/db_dependent/Koha/Biblio.t >+++ b/t/db_dependent/Koha/Biblio.t >@@ -91,19 +91,23 @@ subtest 'hidden_in_opac() tests' => sub { > $schema->storage->txn_rollback; > }; > >-subtest 'items() tests' => sub { >+subtest 'items() and items_count() tests' => sub { > >- plan tests => 3; >+ plan tests => 5; > > $schema->storage->txn_begin; > > my $biblio = $builder->build_sample_biblio(); >+ >+ is( $biblio->items_count, 0, 'No items, count is 0' ); >+ > my $item_1 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber }); > my $item_2 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber }); > > my $items = $biblio->items; > is( ref($items), 'Koha::Items', 'Returns a Koha::Items resultset' ); > is( $items->count, 2, 'Two items in resultset' ); >+ is( $biblio->items_count, $items->count, 'items_count returns the expected value' ); > > my @items = $biblio->items->as_list; > is( scalar @items, 2, 'Same result, but in list context' ); >-- >2.11.0
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 24435
:
97462
|
97463
|
97489
|
97490
| 97561 |
97562