From cee792d2e45bde90dab181235ea307812e9af665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Mei=C3=9Fner?= Date: Fri, 14 Feb 2014 10:01:19 +0100 Subject: [PATCH] Bug 7413: Unit test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch makes the new parameter norenewalbefore known to unit test Circulation_Issuingrule.t. To test: 1) Before applying the patch: prove t/db_dependent/Circulation_Issuingrule.t 2) Notice that the test fails with: $got->{norenewalbefore} = undef $expected->{norenewalbefore} = Does not exist 3) Apply the patch. 4) Run test again and it should pass. Sponsored-by: Hochschule für Gesundheit (hsg), Germany --- t/db_dependent/Circulation_Issuingrule.t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/Circulation_Issuingrule.t b/t/db_dependent/Circulation_Issuingrule.t index fc567a8..7ab439b 100644 --- a/t/db_dependent/Circulation_Issuingrule.t +++ b/t/db_dependent/Circulation_Issuingrule.t @@ -116,6 +116,7 @@ my $sampleissuingrule1 = { finedays => 0, lengthunit => 'Null', renewalperiod => 5, + norenewalbefore => 6, issuelength => 5, chargeperiod => 0, rentaldiscount => '2.000000', @@ -137,6 +138,7 @@ my $sampleissuingrule2 = { maxissueqty => 2, renewalsallowed => 'Null', renewalperiod => 2, + norenewalbefore => 7, reservesallowed => 'Null', issuelength => 2, lengthunit => 'Null', @@ -160,6 +162,7 @@ my $sampleissuingrule3 = { maxissueqty => 3, renewalsallowed => 'Null', renewalperiod => 3, + norenewalbefore => 8, reservesallowed => 'Null', issuelength => 3, lengthunit => 'Null', @@ -183,6 +186,7 @@ $query = 'INSERT INTO issuingrules ( maxissueqty, renewalsallowed, renewalperiod, + norenewalbefore, reservesallowed, issuelength, lengthunit, @@ -198,7 +202,7 @@ $query = 'INSERT INTO issuingrules ( reservecharge, chargename, restrictedtype - ) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'; + ) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'; my $sth = $dbh->prepare($query); $sth->execute( $sampleissuingrule1->{branchcode}, @@ -207,6 +211,7 @@ $sth->execute( $sampleissuingrule1->{maxissueqty}, $sampleissuingrule1->{renewalsallowed}, $sampleissuingrule1->{renewalperiod}, + $sampleissuingrule1->{norenewalbefore}, $sampleissuingrule1->{reservesallowed}, $sampleissuingrule1->{issuelength}, $sampleissuingrule1->{lengthunit}, @@ -230,6 +235,7 @@ $sth->execute( $sampleissuingrule2->{maxissueqty}, $sampleissuingrule2->{renewalsallowed}, $sampleissuingrule2->{renewalperiod}, + $sampleissuingrule2->{norenewalbefore}, $sampleissuingrule2->{reservesallowed}, $sampleissuingrule2->{issuelength}, $sampleissuingrule2->{lengthunit}, @@ -253,6 +259,7 @@ $sth->execute( $sampleissuingrule3->{maxissueqty}, $sampleissuingrule3->{renewalsallowed}, $sampleissuingrule3->{renewalperiod}, + $sampleissuingrule3->{norenewalbefore}, $sampleissuingrule3->{reservesallowed}, $sampleissuingrule3->{issuelength}, $sampleissuingrule3->{lengthunit}, -- 1.7.10.4