Bugzilla – Attachment 43089 Details for
Bug 14888
Move the cities related code to Koha::Cities
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 14888: Add tests for Koha::Cit[y|ies]
PASSED-QA-Bug-14888-Add-tests-for-KohaCityies.patch (text/plain), 2.49 KB, created by
Katrin Fischer
on 2015-10-03 21:27:58 UTC
(
hide
)
Description:
[PASSED QA] Bug 14888: Add tests for Koha::Cit[y|ies]
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2015-10-03 21:27:58 UTC
Size:
2.49 KB
patch
obsolete
>From 80df30aa1fd6aef0903d98281ebc443f388b4851 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 2 Oct 2015 08:48:05 +0100 >Subject: [PATCH] [PASSED QA] Bug 14888: Add tests for Koha::Cit[y|ies] > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > t/db_dependent/Koha/Cities.t | 48 ++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 48 insertions(+) > create mode 100644 t/db_dependent/Koha/Cities.t > >diff --git a/t/db_dependent/Koha/Cities.t b/t/db_dependent/Koha/Cities.t >new file mode 100644 >index 0000000..1f90bd4 >--- /dev/null >+++ b/t/db_dependent/Koha/Cities.t >@@ -0,0 +1,48 @@ >+#!/usr/bin/perl >+ >+# Copyright 2015 Koha Development team >+# >+# 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::City; >+use Koha::Cities; >+use t::lib::TestBuilder; >+ >+my $builder = t::lib::TestBuilder->new; >+my $nb_of_cities = Koha::Cities->search->count; >+my $new_city_1 = Koha::City->new({ >+ city_name => 'my_city_name_for_test_1', >+ city_state => 'my_city_state_for_test_1', >+ city_zipcode => 'my_city_zipcode_for_test_1', >+ city_country => 'my_city_country_for_test_1', >+})->store; >+my $new_city_2 = Koha::City->new({ >+ city_name => 'my_city_name_for_test_2', >+ city_state => 'my_city_state_for_test_2', >+ city_zipcode => 'my_city_zipcode_for_test_2', >+ city_country => 'my_city_country_for_test_2', >+})->store; >+ >+like( $new_city_1->cityid, qr|^\d+$|, 'Adding a new city should have set the cityid'); >+is( Koha::Cities->search->count, $nb_of_cities + 2, 'The 2 cities should have been added' ); >+ >+my $retrieved_city_1 = Koha::Cities->find( $new_city_1->cityid ); >+is( $retrieved_city_1->city_name, $new_city_1->city_name, 'Find a city by id should return the correct city' ); >+ >+$retrieved_city_1->delete; >+is( Koha::Cities->search->count, $nb_of_cities + 1, 'Delete should have deleted the city' ); >-- >1.9.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 14888
:
42844
|
42845
|
42853
|
42854
|
43015
|
43048
|
43049
|
43086
|
43087
|
43088
| 43089 |
43146