Bug 5327 : Adding more unit tests
authorChris Cormack <chrisc@catalyst.net.nz>
Sun, 6 Nov 2011 06:59:34 +0000 (19:59 +1300)
committerPaul Poulain <paul.poulain@biblibre.com>
Wed, 7 Dec 2011 15:17:07 +0000 (16:17 +0100)
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
New tests run without problems.

t/TmplToken.t [new file with mode: 0755]
t/db_dependent/UploadedFile.t

diff --git a/t/TmplToken.t b/t/TmplToken.t
new file mode 100755 (executable)
index 0000000..b9f1612
--- /dev/null
@@ -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");
index dd01e1b..9a09f48 100755 (executable)
@@ -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