Bugzilla – Attachment 125691 Details for
Bug 29082
Add filtering methods to Koha::ArticleRequests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29082: Simplify tests
Bug-29082-Simplify-tests.patch (text/plain), 2.65 KB, created by
Jonathan Druart
on 2021-10-04 10:45:49 UTC
(
hide
)
Description:
Bug 29082: Simplify tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-10-04 10:45:49 UTC
Size:
2.65 KB
patch
obsolete
>From 96a04b00ee91851a25dad31aa7624454ff39c19f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 4 Oct 2021 12:44:51 +0200 >Subject: [PATCH] Bug 29082: Simplify tests > >--- > t/db_dependent/Koha/ArticleRequests.t | 55 ++------------------------- > 1 file changed, 3 insertions(+), 52 deletions(-) > >diff --git a/t/db_dependent/Koha/ArticleRequests.t b/t/db_dependent/Koha/ArticleRequests.t >index 02e9a15bb3d..98b92a3d405 100755 >--- a/t/db_dependent/Koha/ArticleRequests.t >+++ b/t/db_dependent/Koha/ArticleRequests.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 3; >+use Test::More tests => 2; > use Test::MockModule; > > use Koha::ArticleRequest::Status; >@@ -79,9 +79,9 @@ subtest 'requested() tests' => sub { > $schema->storage->txn_rollback; > }; > >-subtest 'filter_by_current() tests' => sub { >+subtest 'filter_by_current / filter_by_finished tests' => sub { > >- plan tests => 1; >+ plan tests => 2; > > $schema->storage->txn_begin; > >@@ -129,55 +129,6 @@ subtest 'filter_by_current() tests' => sub { > > is( $current_article_requests->count, 3, 'Count is correct' ); > >- $schema->storage->txn_rollback; >-}; >- >-subtest 'filter_by_current() tests' => sub { >- >- plan tests => 1; >- >- $schema->storage->txn_begin; >- >- my $ar_requested = $builder->build_object( >- { >- class => 'Koha::ArticleRequests', >- value => { status => Koha::ArticleRequest::Status::Requested } >- } >- ); >- my $ar_pending = $builder->build_object( >- { >- class => 'Koha::ArticleRequests', >- value => { status => Koha::ArticleRequest::Status::Pending } >- } >- ); >- my $ar_processing = $builder->build_object( >- { >- class => 'Koha::ArticleRequests', >- value => { status => Koha::ArticleRequest::Status::Processing } >- } >- ); >- my $ar_completed = $builder->build_object( >- { >- class => 'Koha::ArticleRequests', >- value => { status => Koha::ArticleRequest::Status::Completed } >- } >- ); >- my $ar_cancelled = $builder->build_object( >- { >- class => 'Koha::ArticleRequests', >- value => { status => Koha::ArticleRequest::Status::Canceled } >- } >- ); >- >- my $article_requests = Koha::ArticleRequests->search( >- { >- id => [ >- $ar_requested->id, $ar_pending->id, $ar_processing->id, >- $ar_completed->id, $ar_cancelled->id >- ] >- } >- ); >- > my $finished_article_requests = $article_requests->filter_by_finished; > > is( $finished_article_requests->count, 2, 'Count is correct' ); >-- >2.25.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 29082
:
125159
|
125239
|
125263
|
125639
| 125691