- Timestamp:
- 01/23/12 07:00:46 (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Release01x01/UnitTestContrib/test/unit/EmptyTests.pm
r6912 r13794 1 use strict;2 3 1 # Example test case; use this as a basis to build your own 4 2 5 3 package EmptyTests; 4 use strict; 5 use warnings; 6 6 7 7 use FoswikiTestCase; … … 10 10 use Foswiki; 11 11 use Error qw( :try ); 12 13 my $topicquery;14 12 15 13 sub set_up { … … 20 18 # You can now safely modify $Foswiki::cfg 21 19 22 $topicquery = new Unit::Request('');20 my $topicquery = Unit::Request->new(''); 23 21 $topicquery->path_info('/TestCases/WebHome'); 24 22 try { 25 $this-> {session} = new Foswiki( 'AdminUser' || '' );23 $this->createNewFoswikiSession( 'AdminUser' || '' ); 26 24 my $user = $this->{session}->{user}; 27 25 … … 32 30 Foswiki::Meta->new( $this->{session}, "Temporarytestweb1" ); 33 31 $webObject->populateNewWeb("_default"); 32 $webObject->finish(); 34 33 35 34 # Copy a system web like this: … … 37 36 Foswiki::Meta->new( $this->{session}, "Temporarysystemweb" ); 38 37 $webObject->populateNewWeb("System"); 38 $webObject->finish(); 39 39 40 40 # Create a topic like this: … … 52 52 $this->assert( 0, shift->stringify() || '' ); 53 53 }; 54 55 return; 54 56 } 55 57 … … 61 63 $this->removeWebFixture( $this->{session}, "Temporarytestweb1" ); 62 64 $this->removeWebFixture( $this->{session}, "Temporarysystemweb" ); 63 $this->{session}->finish() if $this->{session};64 65 65 66 # Always do this, and always do it last 66 67 $this->SUPER::tear_down(); 68 69 return; 67 70 } 68 71 … … 77 80 sub test_ { 78 81 my $this = shift; 82 83 return; 79 84 } 80 85
Note: See TracChangeset
for help on using the changeset viewer.
