From 76f9d26117de523441ec30f09addca0beeeda0c9 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Sun, 6 Nov 2011 19:59:34 +1300 Subject: [PATCH] [SIGNED-OFF] Bug 5327 : Adding more unit tests Signed-off-by: Katrin Fischer New tests run without problems. --- 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