Bug 5327 : Adding more unit tests

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
New tests run without problems.
This commit is contained in:
Chris Cormack 2011-11-06 19:59:34 +13:00 committed by Paul Poulain
parent 16c51d0376
commit a9bbeae6cc
2 changed files with 24 additions and 1 deletions

22
t/TmplToken.t Executable file
View file

@ -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");

View file

@ -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());