@@ -, +, @@ --------- -- magically the wrong condition still passes. -- notice the second result value is UNDEFINED. -- notice the first result is an array reference. -- and the last test passes, because unless somehow the array reference was less than 2, it will pass. --- t/db_dependent/NewsChannels.t | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/t/db_dependent/NewsChannels.t +++ a/t/db_dependent/NewsChannels.t @@ -3,7 +3,7 @@ use Modern::Perl; use C4::Dates qw(format_date); use C4::Branch qw(GetBranchName); -use Test::More tests => 10; +use Test::More tests => 12; BEGIN { use_ok('C4::NewsChannels'); @@ -133,6 +133,12 @@ ok( $opac_news_count >= 2, 'Successfully tested get_opac_news for LIB1!' ); # Test GetNewsToDisplay ( $opac_news_count, $arrayref_opac_news ) = GetNewsToDisplay( q{}, 'LIB1' ); +ok( !$arrayref_opac_news, 'Second parameter is ' . + ( defined($arrayref_opac_news) ? + ("Defined as '$arrayref_opac_news'") : "UNDEFINED") + ); +ok ( ref $opac_news_count eq 'ARRAY', + '$opac_news_count is an array reference'); ok( $opac_news_count >= 2, 'Successfully tested GetNewsToDisplay for LIB1!' ); $dbh->rollback; --