Bugzilla – Attachment 67772 Details for
Bug 13208
More complete breadcrumbs when cancelling an order
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13208: [FOLLOW-UP] Tests for Koha::Acquisition::Baskets
Bug-13208-FOLLOW-UP-Tests-for-KohaAcquisitionBaske.patch (text/plain), 2.97 KB, created by
Nick Clemens (kidclamp)
on 2017-10-07 01:13:41 UTC
(
hide
)
Description:
Bug 13208: [FOLLOW-UP] Tests for Koha::Acquisition::Baskets
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-10-07 01:13:41 UTC
Size:
2.97 KB
patch
obsolete
>From 3700b8a587014bdd70661e166734e42feff8e85c Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 5 Sep 2017 03:31:54 +0000 >Subject: [PATCH] Bug 13208: [FOLLOW-UP] Tests for Koha::Acquisition::Baskets > >To test: >prove -v t/db_dependent/Koha/Acquisition/Baskets.t > >Signed-off-by: David Bourgault <david.bourgault@inlibro.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/Koha/Acquisition/Baskets.t | 65 +++++++++++++++++++++++++++++++ > 1 file changed, 65 insertions(+) > create mode 100644 t/db_dependent/Koha/Acquisition/Baskets.t > >diff --git a/t/db_dependent/Koha/Acquisition/Baskets.t b/t/db_dependent/Koha/Acquisition/Baskets.t >new file mode 100644 >index 0000000..45076f5 >--- /dev/null >+++ b/t/db_dependent/Koha/Acquisition/Baskets.t >@@ -0,0 +1,65 @@ >+#!/usr/bin/perl >+ >+# Copyright 2017 Aleisha Amohia <aleisha@catalyst.net.nz> >+# >+# This file is part of Koha >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Test::More tests => 4; >+ >+use Koha::Database; >+use Koha::Acquisition::Basket; >+use Koha::Acquisition::Baskets; >+use Koha::Acquisition::Bookseller; >+ >+use t::lib::TestBuilder; >+ >+my $schema = Koha::Database->new->schema; >+$schema->storage->txn_begin; >+ >+my $builder = t::lib::TestBuilder->new; >+my $num_of_baskets = Koha::Acquisition::Baskets->search->count; >+ >+my $bookseller = Koha::Acquisition::Bookseller->new({ >+ name => 'Bookseller1', >+ currency => 'USD', >+})->store; >+ >+my $basket = Koha::Acquisition::Basket->new({ >+ basketname => 'Basket1', >+ booksellerid => $bookseller->id, >+ is_standing => 0, >+})->store; >+ >+my $basket2 = Koha::Acquisition::Basket->new({ >+ basketname => 'BasketToDelete', >+ booksellerid => $bookseller->id, >+ is_standing => 0, >+})->store; >+ >+like( $basket->basketno, qr|^\d+$|, 'Adding a new basket should have set the basketno'); >+ >+my $retrieved_basket = Koha::Acquisition::Baskets->find( $basket->basketno ); >+is( $retrieved_basket->basketname, $basket->basketname, 'Find a basket by id should return the correct basket' ); >+ >+my $retrieved_bookseller = $retrieved_basket->bookseller; >+is( $retrieved_bookseller->name, $bookseller->name, "Finding the bookseller of a basket by the basket's booksellerid should work as expected" ); >+ >+$basket2->delete; >+is( Koha::Acquisition::Baskets->search->count, $num_of_baskets + 1, 'Delete should have deleted the basket' ); >+ >+$schema->storage->txn_rollback; >-- >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 13208
:
64686
|
64697
|
65176
|
65291
|
65954
|
66161
|
66499
|
66500
|
66501
|
66738
|
66739
|
66740
|
66741
|
66831
|
67167
|
67168
|
67169
|
67170
|
67171
|
67768
|
67769
|
67770
|
67771
| 67772