Bugzilla – Attachment 123980 Details for
Bug 28883
Koha::Objects->_new_from_dbic doesn't work correctly in list context
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28883: Regression tests
Bug-28883-Regression-tests.patch (text/plain), 1.85 KB, created by
David Nind
on 2021-08-19 19:18:39 UTC
(
hide
)
Description:
Bug 28883: Regression tests
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-08-19 19:18:39 UTC
Size:
1.85 KB
patch
obsolete
>From 73c5fa556adf6632d11c91b0455afa02469fcffa Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 19 Aug 2021 10:52:57 -0300 >Subject: [PATCH] Bug 28883: Regression tests > >Signed-off-by: David Nind <david@davidnind.com> >--- > t/db_dependent/Koha/Objects.t | 31 ++++++++++++++++++++++++++++++- > 1 file changed, 30 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Objects.t b/t/db_dependent/Koha/Objects.t >index 554b631741..fec3a81193 100755 >--- a/t/db_dependent/Koha/Objects.t >+++ b/t/db_dependent/Koha/Objects.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 24; >+use Test::More tests => 25; > use Test::Exception; > use Test::MockModule; > use Test::Warn; >@@ -1277,3 +1277,32 @@ subtest 'delete() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest '_new_from_dbic() tests' => sub { >+ >+ plan tests => 7; >+ >+ $schema->storage->txn_begin; >+ >+ my $biblio = $builder->build_sample_biblio(); >+ >+ my $items_scalar = $biblio->items; >+ my @items_list = $biblio->items; >+ >+ is( ref($items_scalar), 'Koha::Items', 'Blessed object type is correct' ); >+ is( $items_scalar->count, 0, 'No items in resultset' ); >+ is( scalar @items_list, 0, 'Empty list in list context' ); >+ >+ my $item_1 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber }); >+ my $item_2 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber }); >+ >+ $items_scalar = $biblio->items; >+ @items_list = $biblio->items; >+ >+ is( $items_scalar->count, 2, 'No items in resultset' ); >+ is( scalar @items_list, 2, 'Empty list in list context' ); >+ is( $items_list[0]->itemnumber, $item_1->itemnumber, 'First element correct' ); >+ is( $items_list[1]->itemnumber, $item_2->itemnumber, 'Second element correct' ); >+ >+ $schema->storage->txn_rollback; >+}; >\ No newline at end of file >-- >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 28883
:
123976
|
123977
|
123980
|
123981
|
123992
|
123993
|
123994
|
123995
|
124181
|
124420