From: Manni H. <man...@us...> - 2008-02-09 09:47:22
|
Update of /cvsroot/popfile/engine/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29248/tests Modified Files: Tag: b0_22_2 TestIMAP.tst Log Message: Wrote tests that make sure that the IMAP module will not allow users to map more than one bucket to a folder. Index: TestIMAP.tst =================================================================== RCS file: /cvsroot/popfile/engine/tests/TestIMAP.tst,v retrieving revision 1.3.4.13 retrieving revision 1.3.4.14 diff -C2 -d -r1.3.4.13 -r1.3.4.14 *** TestIMAP.tst 2 Dec 2007 09:40:19 -0000 1.3.4.13 --- TestIMAP.tst 9 Feb 2008 09:47:25 -0000 1.3.4.14 *************** *** 696,699 **** --- 696,719 ---- test_assert_equal( $im->folder_for_bucket__( 'personal' ), 'other' ); + # The module should not let you map more than one bucket to a folder: + $form = {}; + $form->{imap_3_bucket_folders} = 1; + $form->{imap_folder_for_other} = 'other'; + $form->{imap_folder_for_personal} = 'other'; + $im->validate_item('imap_3_bucket_folders', $tmpl, $language, $form ); + test_assert( $tmpl->param('IMAP_buckets_to_folders_if_error') ); + test_assert_equal( $im->folder_for_bucket__( 'other' ), 'personal' ); + test_assert_equal( $im->folder_for_bucket__( 'personal' ), 'other' ); + + # The same goes for pseudo buckets: + $form = {}; + $form->{imap_3_bucket_folders} = 1; + $form->{imap_folder_for_unclassified} = 'other'; + $form->{imap_folder_for_personal} = 'other'; + $im->validate_item('imap_3_bucket_folders', $tmpl, $language, $form ); + test_assert( $tmpl->param('IMAP_buckets_to_folders_if_error') ); + test_assert_equal( $im->folder_for_bucket__( 'unclassified' ), 'unclassified' ); + test_assert_equal( $im->folder_for_bucket__( 'personal' ), 'other' ); + # imap-update-mailbox-list.thtml $form = {}; |