Bugzilla – Attachment 50293 Details for
Bug 15009
Planning dropdown button in aqbudget can have empty line
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15009 - Adds unit tests for C4::Budget::GetBudgetAuthCats
Bug-15009---Adds-unit-tests-for-C4BudgetGetBudgetA.patch (text/plain), 2.38 KB, created by
Marc Véron
on 2016-04-17 08:20:06 UTC
(
hide
)
Description:
Bug 15009 - Adds unit tests for C4::Budget::GetBudgetAuthCats
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2016-04-17 08:20:06 UTC
Size:
2.38 KB
patch
obsolete
>From 18475a028ae0a8f82c4ef45980cc1eba5c4c2ecb Mon Sep 17 00:00:00 2001 >From: charles <charles.farmer@inlibro.com> >Date: Fri, 25 Mar 2016 17:09:24 -0400 >Subject: [PATCH] Bug 15009 - Adds unit tests for > C4::Budget::GetBudgetAuthCats >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Marc Véron <veron@veron.ch> >--- > t/db_dependent/Budgets.t | 51 +++++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 50 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Budgets.t b/t/db_dependent/Budgets.t >index 0f59b8b..269b147 100755 >--- a/t/db_dependent/Budgets.t >+++ b/t/db_dependent/Budgets.t >@@ -1,5 +1,5 @@ > use Modern::Perl; >-use Test::More tests => 130; >+use Test::More tests => 133; > > BEGIN { > use_ok('C4::Budgets') >@@ -623,6 +623,55 @@ is( C4::Budgets::GetBudget($budget_id2)->{budget_owner_id}, > is( C4::Budgets::GetBudget($budget_id21)->{budget_owner_id}, > undef, "SetOwnerToFundHierarchy should have set John Doe $john_doe for budget 21 ($budget_id21)" ); > >+# Test GetBudgetAuthCats >+ >+my $budgetPeriodId = 1; >+ >+my $bdgts = GetBudgets(); >+my $i = 0; >+for my $budget ( @{$bdgts} ) >+{ >+ $budget->{sort1_authcat} = "sort1_authcat_$i"; >+ $budget->{sort2_authcat} = "sort2_authcat_$i"; >+ $budget->{budget_period_id} = $budgetPeriodId; >+ ModBudget( $budget ); >+ $i++; >+} >+ >+my $authCat = GetBudgetAuthCats($budgetPeriodId); >+ >+is( scalar @{$authCat}, $i * 2, "GetBudgetAuthCats returns only non-empty sorting categories (no empty authCat in db)" ); >+ >+$i = 0; >+for my $budget ( @{$bdgts} ) >+{ >+ $budget->{sort1_authcat} = "sort1_authcat_$i"; >+ $budget->{sort2_authcat} = ""; >+ $budget->{budget_period_id} = $budgetPeriodId; >+ ModBudget( $budget ); >+ $i++; >+} >+ >+$authCat = GetBudgetAuthCats($budgetPeriodId); >+ >+is( scalar @{$authCat}, $i, "GetBudgetAuthCats returns only non-empty sorting categories (empty sort2_authcat on all records)" ); >+ >+$i = 0; >+for my $budget ( @{$bdgts} ) >+{ >+ $budget->{sort1_authcat} = ""; >+ $budget->{sort2_authcat} = ""; >+ $budget->{budget_period_id} = $budgetPeriodId; >+ ModBudget( $budget ); >+ $i++; >+} >+ >+$authCat = GetBudgetAuthCats($budgetPeriodId); >+ >+is( scalar @{$authCat}, 0, "GetBudgetAuthCats returns only non-empty sorting categories (all empty)" ); >+ >+# /Test GetBudgetAuthCats >+ > sub _get_dependencies { > my ($budget_hierarchy) = @_; > my $graph; >-- >1.7.10.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 15009
:
43391
|
43392
|
44262
|
49601
|
50293
|
50314
|
50315
|
50316
|
50317