Bugzilla – Attachment 147341 Details for
Bug 32997
Add GET endpoint for listing authorised value categories
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32997: Add tests
Bug-32997-Add-tests.patch (text/plain), 2.12 KB, created by
Nick Clemens (kidclamp)
on 2023-02-24 15:41:15 UTC
(
hide
)
Description:
Bug 32997: Add tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2023-02-24 15:41:15 UTC
Size:
2.12 KB
patch
obsolete
>From 0ef2d80fc6c2ea538ca1ab9f913f97cc3e923e8b Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Thu, 23 Feb 2023 14:37:20 +0000 >Subject: [PATCH] Bug 32997: Add tests > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/AuthorisedValues.t | 35 +++++++++++++++++++++++++++++-- > 1 file changed, 33 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/AuthorisedValues.t b/t/db_dependent/AuthorisedValues.t >index e9f64ed5db..a1bf7b4812 100755 >--- a/t/db_dependent/AuthorisedValues.t >+++ b/t/db_dependent/AuthorisedValues.t >@@ -143,8 +143,8 @@ is_deeply( > 'categories must be ordered by category names' > ); > >-subtest 'search_by_*_field + find_by_koha_field + get_description' => sub { >- plan tests => 5; >+subtest 'search_by_*_field + find_by_koha_field + get_description + authorised_values' => sub { >+ plan tests => 6; > > my $test_cat = Koha::AuthorisedValueCategories->find('TEST'); > $test_cat->delete if $test_cat; >@@ -252,6 +252,37 @@ subtest 'search_by_*_field + find_by_koha_field + get_description' => sub { > ], > ); > }; >+ subtest 'authorised_values' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $authorised_value_category = >+ $builder->build_object( >+ { >+ class => 'Koha::AuthorisedValueCategories', >+ value => { >+ category_name => 'test_avs' >+ } >+ } >+ ); >+ >+ is( $authorised_value_category->authorised_values->count, 0, "no authorised values yet" ); >+ >+ my $av1 = Koha::AuthorisedValue->new( >+ { >+ category => 'test_avs', >+ authorised_value => 'value 1', >+ lib => 'display value 1', >+ lib_opac => 'opac display value 1', >+ imageurl => 'image1.png', >+ } >+ )->store(); >+ is( $authorised_value_category->authorised_values->count, 1, "one authorised value" ); >+ >+ $schema->storage->txn_rollback; >+ }; > }; > > $schema->storage->txn_rollback; >-- >2.30.2
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 32997
:
146970
|
147224
|
147237
|
147296
|
147340
| 147341 |
147640