Bugzilla – Attachment 24423 Details for
Bug 11543
Increasing test coverage for C4::Category
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 11543: (followup) Increasing test coverage for Category.pm
PASSED-QA-Bug-11543-followup-Increasing-test-cover.patch (text/plain), 2.05 KB, created by
Katrin Fischer
on 2014-01-15 19:41:26 UTC
(
hide
)
Description:
[PASSED QA] Bug 11543: (followup) Increasing test coverage for Category.pm
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-01-15 19:41:26 UTC
Size:
2.05 KB
patch
obsolete
>From 4aeccc9945ec69d74cf64ce2cbac92a156790b51 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 15 Jan 2014 18:47:59 +0100 >Subject: [PATCH] [PASSED QA] Bug 11543: (followup) Increasing test coverage > for Category.pm > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >--- > t/db_dependent/Category.t | 26 ++++++++++++++++---------- > 1 file changed, 16 insertions(+), 10 deletions(-) > >diff --git a/t/db_dependent/Category.t b/t/db_dependent/Category.t >index 056dd37..21a0cf8 100755 >--- a/t/db_dependent/Category.t >+++ b/t/db_dependent/Category.t >@@ -3,22 +3,28 @@ > # This Koha test module is a stub! > # Add more tests here!!! > >-use strict; >-use warnings; >+use Modern::Perl; > >-use Test::More tests => 2; >+use Test::More tests => 3; >+ >+use_ok('C4::Category'); > >-BEGIN { >- use_ok('C4::Category'); >-} > use C4::Context; > my $dbh = C4::Context->dbh; > $dbh->{RaiseError} = 1; > $dbh->{AutoCommit} = 0; > >-my $sth=$dbh->prepare("INSERT INTO categories (categorycode,description,enrolmentperiod,enrolmentperioddate,upperagelimit,dateofbirthrequired, >-enrolmentfee,reservefee,hidelostitems,overduenoticerequired,category_type) values (?,?,?,?,?,?,?,?,?,?,?)"); >-$sth->execute("test", "Desc", 12, "2014-01-02", 99, 1, 1.5, 2.5, 0, 0, "A") || die $sth->errstr; >-ok( my @categories = C4::Category->all); >+my $sth=$dbh->prepare(' >+ INSERT INTO categories( categorycode, description, enrolmentperiod, enrolmentperioddate, upperagelimit, dateofbirthrequired, enrolmentfee, reservefee, hidelostitems, overduenoticerequired, category_type ) >+ VALUES (?,?,?,?,?,?,?,?,?,?,?) >+'); >+ >+my $nonexistent_categorycode = 'NONEXISTEN'; >+$sth->execute($nonexistent_categorycode, "Desc", 12, "2014-01-02", 99, 1, 1.5, 2.5, 0, 0, "A") || die $sth->errstr; >+my @categories = C4::Category->all; >+ok( @categories, 'all returns categories' ); >+ >+my $match = grep {$_->{categorycode} eq $nonexistent_categorycode } @categories; >+is( $match, 1, 'all returns the inserted category'); > > $dbh->rollback; >-- >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 11543
:
24252
|
24257
|
24258
|
24318
|
24419
|
24420
|
24422
| 24423