Changeset 816 for trunk/UnitTestContrib/test/unit/AutoAttachTests.pm
- Timestamp:
- 11/19/08 19:11:33 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UnitTestContrib/test/unit/AutoAttachTests.pm
r492 r816 3 3 # Test cases: 4 4 # 1) Autoattach = off. Save a topic referring to an attachmentMissing that does not exist. 5 # 2) Add attachmentAdded into the attachment area for that topic, circumventing TWiki5 # 2) Add attachmentAdded into the attachment area for that topic, circumventing Foswiki 6 6 # 3) Turn autoattach = on. Ask for the list of attachments. attachmentAdded should appear. attachmentMissing should not. 7 7 8 8 package AutoAttachTests; 9 use base qw( TWikiFnTestCase);9 use base qw(FoswikiFnTestCase); 10 10 11 11 use strict; 12 use TWiki;13 use TWiki::Meta;12 use Foswiki; 13 use Foswiki::Meta; 14 14 use Error qw( :try ); 15 use TWiki::UI::Save;16 use TWiki::OopsException;15 use Foswiki::UI::Save; 16 use Foswiki::OopsException; 17 17 use Devel::Symdump; 18 18 … … 72 72 my $this = shift; 73 73 my ($topic, @filenames) = @_; 74 my $dir = $ TWiki::cfg{PubDir};74 my $dir = $Foswiki::cfg{PubDir}; 75 75 $dir = "$dir/$this->{test_web}/$topic"; 76 76 #print STDERR "DEBUG: dir=$dir\n"; … … 94 94 95 95 sub test_autoattach { 96 # print "Default AutoAttachPubFiles = $ TWiki::cfg{AutoAttachPubFiles}\n";97 $ TWiki::cfg{AutoAttachPubFiles} = 1;98 # print "AutoAttachPubFiles now = $ TWiki::cfg{AutoAttachPubFiles}\n";96 # print "Default AutoAttachPubFiles = $Foswiki::cfg{AutoAttachPubFiles}\n"; 97 $Foswiki::cfg{AutoAttachPubFiles} = 1; 98 # print "AutoAttachPubFiles now = $Foswiki::cfg{AutoAttachPubFiles}\n"; 99 99 100 100 my $this = shift; … … 103 103 $this->verify_normal_attachment($topic, "afile.txt"); 104 104 $this->verify_normal_attachment($topic, "bfile.txt"); 105 $this->addMissingAttachment($topic, 'bogusAttachment.txt', "I'm a figment of TWiki's imagination");105 $this->addMissingAttachment($topic, 'bogusAttachment.txt', "I'm a figment of Foswiki's imagination"); 106 106 $this->addMissingAttachment($topic, 'ressurectedComment.txt', 'ressurected attachment comment'); 107 107 $this->sneakAttachmentsAddedToTopic($topic, 'sneakedfile1.txt','sneakedfile2.txt', 'commavfilesshouldbeignored2.txt,v','_hiddenAttachment.txt', 'ressurectedComment.txt'); … … 169 169 $this->assert($this->{twiki}->{store}->topicExists($this->{test_web}, $topic)); 170 170 171 open( FILE, ">$ TWiki::cfg{TempfileDir}/$attachment" );171 open( FILE, ">$Foswiki::cfg{TempfileDir}/$attachment" ); 172 172 print FILE "Test attachment\n"; 173 173 close(FILE); … … 179 179 $this->{twiki}->{store}->saveAttachment( 180 180 $this->{test_web}, $topic, $attachment, $this->{test_user_wikiname}, 181 { file => "$ TWiki::cfg{TempfileDir}/$attachment", comment => 'comment 1' } );182 183 unlink "$ TWiki::cfg{TempfileDir}/$attachment";181 { file => "$Foswiki::cfg{TempfileDir}/$attachment", comment => 'comment 1' } ); 182 183 unlink "$Foswiki::cfg{TempfileDir}/$attachment"; 184 184 185 185 # Check revision number
Note: See TracChangeset
for help on using the changeset viewer.
