Bugzilla – Attachment 97353 Details for
Bug 24418
Add Koha::Biblio->suggestions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24418: Unit tests
Bug-24418-Unit-tests.patch (text/plain), 1.62 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-01-14 13:34:10 UTC
(
hide
)
Description:
Bug 24418: Unit tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-01-14 13:34:10 UTC
Size:
1.62 KB
patch
obsolete
>From a4cb835f30e06b69637235b4fe5902efff3b31f2 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 14 Jan 2020 10:09:12 -0300 >Subject: [PATCH] Bug 24418: Unit tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Biblio.t | 36 +++++++++++++++++++++++++++++++++++- > 1 file changed, 35 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t >index 91017eeaae..e3a41399bb 100644 >--- a/t/db_dependent/Koha/Biblio.t >+++ b/t/db_dependent/Koha/Biblio.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 9; >+use Test::More tests => 10; > > use C4::Biblio; > use Koha::Database; >@@ -456,3 +456,37 @@ subtest 'to_api() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'suggestions() tests' => sub { >+ >+ plan tests => 3; >+ >+ $schema->storage->txn_begin; >+ >+ my $biblio = $builder->build_sample_biblio(); >+ >+ is( ref($biblio->suggestions), 'Koha::Suggestions', 'Return type is correct' ); >+ >+ is_deeply( >+ $biblio->suggestions->unblessed, >+ [], >+ '->suggestions returns an empty Koha::Suggestions resultset' >+ ); >+ >+ my $suggestion = $builder->build_object( >+ { >+ class => 'Koha::Suggestions', >+ value => { biblionumber => $biblio->biblionumber } >+ } >+ ); >+ >+ my $suggestions = $biblio->suggestions->unblessed; >+ >+ is_deeply( >+ $biblio->suggestions->unblessed, >+ [ $suggestion->unblessed ], >+ '->suggestions returns the related Koha::Suggestion objects' >+ ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.25.0
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 24418
:
97349
|
97350
|
97351
|
97353
|
97365
|
97366
|
97367
|
97382
|
97383
|
97384