Bugzilla – Attachment 67161 Details for
Bug 18584
Our legacy code contains trailing-spaces
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
David Bourgault
on 2017-09-15 19:33:22 UTC
(
hide
)
Description:
Bug 13208: [FOLLOW-UP] Tests for Koha::Acquisition::Baskets
Filename:
MIME Type:
Creator:
David Bourgault
Created:
2017-09-15 19:33:22 UTC
Size:
2.97 KB
patch
obsolete
>From cd08debd111c90f6848645be2ba9b4e12153551a 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> > >https://bugs.koha-community.org/show_bug.cgi?id=18584 >--- > 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.7.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 18584
:
64236
|
64237
|
64238
|
67095
|
67096
|
67097
|
67157
|
67158
|
67159
|
67160
|
67161
|
79734
|
79743
|
79758
|
79811
|
79953
|
81990
|
82337
|
82347
|
85966
|
85967
|
85968
|
87746
|
87750
|
87775
|
175456
|
175458
|
175610