From 1f8954b140d6733bc78c13b13f28c027fa5ce515 Mon Sep 17 00:00:00 2001 From: Mason James Date: Mon, 31 Jul 2017 04:04:35 +1200 Subject: [PATCH] Revert "Bug 18613: Add unit tests for getletter" This reverts commit 212d3bd9b9e07ddd76d7fbb72ae7b70c762fc058. --- t/db_dependent/Letters.t | 43 +++++++++------------------------------- 1 file changed, 9 insertions(+), 34 deletions(-) diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t index 97cb6c3994..5cefe52152 100644 --- a/t/db_dependent/Letters.t +++ b/t/db_dependent/Letters.t @@ -179,38 +179,15 @@ is( $letters->[0]->{name}, 'my name', 'GetLetters gets the name correctly' ); # getletter -subtest 'getletter' => sub { - plan tests => 16; - my $letter = C4::Letters::getletter('my module', 'my code', $library->{branchcode}, 'email'); - is( $letter->{branchcode}, $library->{branchcode}, 'GetLetters gets the branch code correctly' ); - is( $letter->{module}, 'my module', 'GetLetters gets the module correctly' ); - is( $letter->{code}, 'my code', 'GetLetters gets the code correctly' ); - is( $letter->{name}, 'my name', 'GetLetters gets the name correctly' ); - is( $letter->{is_html}, 1, 'GetLetters gets the boolean is_html correctly' ); - is( $letter->{title}, $title, 'GetLetters gets the title correctly' ); - is( $letter->{content}, $content, 'GetLetters gets the content correctly' ); - is( $letter->{message_transport_type}, 'email', 'GetLetters gets the message type correctly' ); - - my $context = Test::MockModule->new('C4::Context'); - $context->mock( 'userenv', sub { - return { branch => "anotherlib" } - }); - - t::lib::Mocks::mock_preference('IndependentBranches', 1); - $letter = C4::Letters::getletter('my module', 'my code', $library->{branchcode}, 'email'); - is( $letter->{branchcode}, $library->{branchcode}, 'GetLetters gets the branch code correctly' ); - is( $letter->{module}, 'my module', 'GetLetters gets the module correctly' ); - is( $letter->{code}, 'my code', 'GetLetters gets the code correctly' ); - is( $letter->{name}, 'my name', 'GetLetters gets the name correctly' ); - is( $letter->{is_html}, 1, 'GetLetters gets the boolean is_html correctly' ); - is( $letter->{title}, $title, 'GetLetters gets the title correctly' ); - is( $letter->{content}, $content, 'GetLetters gets the content correctly' ); - is( $letter->{message_transport_type}, 'email', 'GetLetters gets the message type correctly' ); - - $context->unmock('userenv'); -}; - - +my $letter = C4::Letters::getletter('my module', 'my code', $library->{branchcode}, 'email'); +is( $letter->{branchcode}, $library->{branchcode}, 'GetLetters gets the branch code correctly' ); +is( $letter->{module}, 'my module', 'GetLetters gets the module correctly' ); +is( $letter->{code}, 'my code', 'GetLetters gets the code correctly' ); +is( $letter->{name}, 'my name', 'GetLetters gets the name correctly' ); +is( $letter->{is_html}, 1, 'GetLetters gets the boolean is_html correctly' ); +is( $letter->{title}, $title, 'GetLetters gets the title correctly' ); +is( $letter->{content}, $content, 'GetLetters gets the content correctly' ); +is( $letter->{message_transport_type}, 'email', 'GetLetters gets the message type correctly' ); # Regression test for Bug 14206 $dbh->do( q|INSERT INTO letter(branchcode,module,code,name,is_html,title,content,message_transport_type) VALUES ('FFL','my module','my code','my name',1,?,?,'print')|, undef, $title, $content ); @@ -219,8 +196,6 @@ is( $letter14206_a->{message_transport_type}, 'print', 'Bug 14206 - message_tran my $letter14206_b = C4::Letters::getletter('my module', 'my code', 'FFL', 'print'); is( $letter14206_b->{message_transport_type}, 'print', 'Bug 14206 - message_transport_type passed, correct mtt detected' ); - - # test for overdue_notices.pl my $overdue_rules = { letter1 => 'my code', -- 2.39.5