[Patches] [PATCH] Bug 5327 : Adding more unit tests

koha-patchbot at kohaaloha.com koha-patchbot at kohaaloha.com
Sun Nov 6 20:30:03 NZDT 2011


From: Chris Cormack <chrisc at catalyst.net.nz>
Date: Sun, 6 Nov 2011 19:59:34 +1300
Subject: [PATCH] Bug 5327 : Adding more unit tests

---
 t/TmplToken.t                 |   22 ++++++++++++++++++++++
 t/db_dependent/UploadedFile.t |    3 ++-
 2 files changed, 24 insertions(+), 1 deletions(-)
 create mode 100755 t/TmplToken.t

diff --git a/t/TmplToken.t b/t/TmplToken.t
new file mode 100755
index 0000000..b9f1612
--- /dev/null
+++ b/t/TmplToken.t
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+#
+# This Koha test module is a stub!  
+# Add more tests here!!!
+
+use strict;
+use warnings;
+use C4::TmplTokenType;
+use Test::More tests => 7;
+
+BEGIN {
+        use_ok('C4::TmplToken');
+}
+
+ok (my $token = C4::TmplToken->new('test',C4::TmplTokenType::TEXT,10,'/tmp/translate.txt'), "Create new");
+ok ($token->string eq 'test', "String works");
+ok ($token->type == C4::TmplTokenType::TEXT, "Token works");
+ok ($token->line_number == 10, "Line number works");
+ok ($token->pathname eq '/tmp/translate.txt', "Path works");
+
+
+ok ($token->text_p, "text_p works");
diff --git a/t/db_dependent/UploadedFile.t b/t/db_dependent/UploadedFile.t
index dd01e1b..9a09f48 100755
--- a/t/db_dependent/UploadedFile.t
+++ b/t/db_dependent/UploadedFile.t
@@ -6,9 +6,10 @@
 use strict;
 use warnings;
 
-use Test::More tests => 1;
+use Test::More tests => 2;
 
 BEGIN {
         use_ok('C4::UploadedFile');
 }
 
+ok(my $file = C4::UploadedFile->new());
\ No newline at end of file
-- 
1.7.5.4


More information about the Patches mailing list