Bugzilla – Attachment 51098 Details for
Bug 16170
Pseudo foreign key in Items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16170: [QA Follow-up] Adjust Items.t
Bug-16170-QA-Follow-up-Adjust-Itemst.patch (text/plain), 2.05 KB, created by
Kyle M Hall (khall)
on 2016-05-02 12:52:31 UTC
(
hide
)
Description:
Bug 16170: [QA Follow-up] Adjust Items.t
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-05-02 12:52:31 UTC
Size:
2.05 KB
patch
obsolete
>From 07a3cf32c5ca7dd3ac62dce1fa83f70fa223c8f7 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 1 Apr 2016 09:24:04 +0200 >Subject: [PATCH] Bug 16170: [QA Follow-up] Adjust Items.t > >Items.t inserts an item via biblioitem not correctly linked to biblio. >The new foreign key constraint does not allow that. >Actually, we should be choosing to either remove biblioitems from Koha or >remove biblionumber from items. > >Note: This seems to be the only case where an item is added this way. > >Test plan: >Run Items.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/Items.t | 25 ++++++++++--------------- > 1 file changed, 10 insertions(+), 15 deletions(-) > >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index 5df6eb5..bd625f8 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -228,21 +228,16 @@ subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { > > $schema->storage->txn_begin; > >- my $biblio = >- $schema->resultset('Biblio')->create( >- { >- title => "Test title", >- biblioitems => [ >- { >- itemtype => 'BIB_LEVEL', >- items => [ { itype => "ITEM_LEVEL" } ] >- } >- ] >- } >- ); >- >- my @bi = $biblio->biblioitems(); >- my ( $item ) = $bi[0]->items(); >+ my $biblio = $schema->resultset('Biblio')->create({ >+ title => "Test title", >+ biblioitems => [ { itemtype => 'BIB_LEVEL' } ], >+ }); >+ my $biblioitem = $biblio->biblioitems->first; >+ my $item = $schema->resultset('Item')->create({ >+ biblioitemnumber => $biblioitem->biblioitemnumber, >+ biblionumber => $biblio->biblionumber, >+ itype => "ITEM_LEVEL", >+ }); > > t::lib::Mocks::mock_preference( 'item-level_itypes', 0 ); > is( $item->effective_itemtype(), 'BIB_LEVEL', '$item->itemtype() returns biblioitem.itemtype when item-level_itypes is disabled' ); >-- >2.1.4
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 16170
:
49681
|
49706
|
49707
|
49708
|
49723
|
49724
|
49771
|
49772
|
51096
|
51097
| 51098 |
51099