Bugzilla – Attachment 27563 Details for
Bug 7180
Order from staged file improvements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 7180: Add UT for C4::Budgets::GetBudgetByCode
PASSED-QA-Bug-7180-Add-UT-for-C4BudgetsGetBudgetBy.patch (text/plain), 1.97 KB, created by
Katrin Fischer
on 2014-04-25 05:22:58 UTC
(
hide
)
Description:
[PASSED QA] Bug 7180: Add UT for C4::Budgets::GetBudgetByCode
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-04-25 05:22:58 UTC
Size:
1.97 KB
patch
obsolete
>From 1e56c4a39b7900ece4c1d96064a6d41b62b1ccc0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 21 Mar 2013 13:27:39 +0100 >Subject: [PATCH] [PASSED QA] Bug 7180: Add UT for C4::Budgets::GetBudgetByCode > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >--- > C4/Budgets.pm | 2 ++ > t/db_dependent/Budgets.t | 8 +++++++- > 2 files changed, 9 insertions(+), 1 deletion(-) > >diff --git a/C4/Budgets.pm b/C4/Budgets.pm >index a49d798..a8931ed 100644 >--- a/C4/Budgets.pm >+++ b/C4/Budgets.pm >@@ -713,6 +713,8 @@ sub GetBudgetByCode { > SELECT * > FROM aqbudgets > WHERE budget_code = ? >+ ORDER BY budget_id DESC >+ LIMIT 1 > }; > my $sth = $dbh->prepare( $query ); > $sth->execute( $budget_code ); >diff --git a/t/db_dependent/Budgets.t b/t/db_dependent/Budgets.t >index bfb910b..54beddf 100755 >--- a/t/db_dependent/Budgets.t >+++ b/t/db_dependent/Budgets.t >@@ -1,6 +1,6 @@ > use strict; > use warnings; >-use Test::More tests=>20; >+use Test::More tests => 22; > > BEGIN {use_ok('C4::Budgets') } > use C4::Dates; >@@ -94,6 +94,7 @@ ok($budget_id=AddBudget( > > my $budget; > ok($budget=GetBudget($budget_id) ,"GetBudget OK"); >+$budget_id = $budget->{budget_id}; > $$budget{budget_permission}=1; > ok($mod_status=ModBudget($budget),"ModBudget OK"); > ok(GetBudgets()>0, >@@ -109,6 +110,11 @@ ok(GetBudgets({budget_period_id=>GetBudgetPeriod($bpid)->{budget_period_id}},[{" > my $budget_name = GetBudgetName( $budget_id ); > is($budget_name, $budget->{budget_name}, "Test the GetBudgetName routine"); > >+my $budget_code = $budget->{budget_code}; >+my $budget_by_code = GetBudgetByCode( $budget_code ); >+is($budget_by_code->{budget_id}, $budget_id, "GetBudgetByCode, check id"); >+is($budget_by_code->{budget_notes}, 'This is a note', "GetBudgetByCode, check notes"); >+ > my $second_budget_id; > ok($second_budget_id=AddBudget( > { budget_code => "ZZZZ", >-- >1.8.3.2
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 7180
:
6234
|
13019
|
15023
|
15048
|
15617
|
15677
|
15934
|
15935
|
16014
|
16505
|
16511
|
16544
|
16566
|
16613
|
19066
|
19067
|
19068
|
19316
|
19587
|
19588
|
19589
|
19590
|
19641
|
19645
|
20900
|
20901
|
20902
|
20903
|
20904
|
20926
|
20933
|
20934
|
20935
|
20978
|
20979
|
21004
|
21014
|
21017
|
21117
|
21462
|
21463
|
21464
|
21465
|
21466
|
21467
|
21468
|
21469
|
21470
|
21471
|
21472
|
21473
|
21474
|
21514
|
22546
|
22547
|
22548
|
22549
|
22550
|
22551
|
22552
|
22553
|
22554
|
22555
|
22556
|
22557
|
22558
|
22559
|
24052
|
24053
|
24054
|
24055
|
24056
|
24057
|
24058
|
24059
|
24060
|
24061
|
24062
|
24063
|
24064
|
24065
|
24636
|
24637
|
24638
|
24639
|
24640
|
24641
|
24642
|
24643
|
24644
|
24645
|
24646
|
24647
|
24648
|
24649
|
24708
|
24709
|
24710
|
24711
|
24712
|
24713
|
24714
|
24715
|
24716
|
24717
|
24718
|
24719
|
24720
|
24721
|
25908
|
26950
|
26951
|
26952
|
26953
|
26954
|
26955
|
26956
|
26957
|
26958
|
26959
|
26960
|
26961
|
26962
|
26963
|
26964
|
27128
|
27131
|
27136
|
27160
|
27325
|
27408
|
27409
|
27410
|
27411
|
27412
|
27413
|
27414
|
27415
|
27416
|
27417
|
27418
|
27419
|
27420
|
27421
|
27422
|
27423
|
27424
|
27451
|
27520
|
27561
|
27562
|
27563
|
27564
|
27565
|
27566
|
27567
|
27568
|
27569
|
27570
|
27571
|
27572
|
27573
|
27574
|
27575
|
27576
|
27577
|
27578
|
27829
|
27830
|
27831
|
27832
|
27833
|
27834
|
27835
|
27836
|
27837
|
27838
|
27839
|
27840
|
27841
|
27842
|
27843
|
27844
|
27845
|
27846
|
27847
|
27848
|
27849
|
27850
|
27851
|
27852
|
27853
|
27854
|
27855
|
27856
|
27857
|
27858
|
27859
|
27860
|
27861
|
27862
|
27863
|
27864
|
27865
|
27866