Bugzilla – Attachment 125251 Details for
Bug 29105
Add effective_item_type_id to the API items responses
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29105: Unit test
Bug-29105-Unit-test.patch (text/plain), 1.58 KB, created by
Martin Renvoize
on 2021-09-24 14:16:48 UTC
(
hide
)
Description:
Bug 29105: Unit test
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2021-09-24 14:16:48 UTC
Size:
1.58 KB
patch
obsolete
>From bcf06c54dfe3ccdc1372a2b5f1accbd39bb3d537 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 24 Sep 2021 15:13:55 +0100 >Subject: [PATCH] Bug 29105: Unit test > >--- > t/db_dependent/api/v1/items.t | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/items.t b/t/db_dependent/api/v1/items.t >index 4136c28a08e..a2b84fd7f34 100755 >--- a/t/db_dependent/api/v1/items.t >+++ b/t/db_dependent/api/v1/items.t >@@ -101,7 +101,7 @@ subtest 'list() tests' => sub { > > subtest 'get() tests' => sub { > >- plan tests => 9; >+ plan tests => 15; > > $schema->storage->txn_begin; > >@@ -139,6 +139,24 @@ subtest 'get() tests' => sub { > ->status_is(404) > ->json_is( '/error' => 'Item not found' ); > >+ t::lib::Mocks::mock_preference( 'item-level_itypes', 0 ); >+ >+ my $biblio = $builder->build_sample_biblio; >+ my $itype = >+ $builder->build_object( { class => 'Koha::ItemTypes' } )->itemtype; >+ $item = $builder->build_sample_item( >+ { biblionumber => $biblio->biblionumber, itype => $itype } ); >+ >+ $t->get_ok( "//$userid:$password@/api/v1/items/" . $item->itemnumber ) >+ ->status_is( 200, 'SWAGGER3.2.2' ) >+ ->json_is( '/item_type' => $biblio->itemtype, 'item-level_itypes:0' ); >+ >+ t::lib::Mocks::mock_preference( 'item-level_itypes', 1 ); >+ >+ $t->get_ok( "//$userid:$password@/api/v1/items/" . $item->itemnumber ) >+ ->status_is( 200, 'SWAGGER3.2.2' ) >+ ->json_is( '/item_type' => $itype, 'item-level_itype:1' ); >+ > $schema->storage->txn_rollback; > }; > >-- >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 29105
:
125235
|
125251
|
125252
|
137504
|
137505
|
137572
|
137573