Bugzilla – Attachment 123992 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.95 KB, created by
Marcel de Rooy
on 2021-08-20 08:48:14 UTC
(
hide
)
Description:
Bug 28883: Regression tests
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2021-08-20 08:48:14 UTC
Size:
1.95 KB
patch
obsolete
>From 63e3fc8997cb090d65dda4836efd42202e924b52 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 >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > 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