Changeset 816 for trunk/UnitTestContrib/test/unit/ExceptionTests.pm
- Timestamp:
- 11/19/08 19:11:33 (4 years ago)
- File:
-
- 1 edited
-
trunk/UnitTestContrib/test/unit/ExceptionTests.pm (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/UnitTestContrib/test/unit/ExceptionTests.pm
r14 r816 1 1 package ExceptionTests; 2 use base TWikiTestCase;2 use base FoswikiTestCase; 3 3 4 4 use strict; 5 5 6 6 use Error qw( :try ); 7 use TWiki::OopsException;8 use TWiki::UI::Oops;7 use Foswiki::OopsException; 8 use Foswiki::UI::Oops; 9 9 10 10 # Check an OopsException with one non-array parameter … … 12 12 my $this = shift; 13 13 try { 14 throw TWiki::OopsException(14 throw Foswiki::OopsException( 15 15 'templatename', 16 16 web => 'webname', … … 19 19 keep => 1, 20 20 params => 'phlegm'); 21 } catch TWiki::OopsException with {21 } catch Foswiki::OopsException with { 22 22 my $e = shift; 23 $this->assert($e->isa(' TWiki::OopsException'));23 $this->assert($e->isa('Foswiki::OopsException')); 24 24 $this->assert_str_equals('webname', $e->{web}); 25 25 $this->assert_str_equals('topicname', $e->{topic}); … … 37 37 my $this = shift; 38 38 try { 39 throw TWiki::OopsException(39 throw Foswiki::OopsException( 40 40 'templatename', 41 41 web => 'webname', 42 42 topic => 'topicname', 43 43 params => [ 'phlegm', '<pus>' ]); 44 } catch TWiki::OopsException with {44 } catch Foswiki::OopsException with { 45 45 my $e = shift; 46 $this->assert($e->isa(' TWiki::OopsException'));46 $this->assert($e->isa('Foswiki::OopsException')); 47 47 $this->assert_str_equals('webname', $e->{web}); 48 48 $this->assert_str_equals('topicname', $e->{topic}); … … 56 56 sub upchuck { 57 57 my $session = shift; 58 my $e = new TWiki::OopsException(58 my $e = new Foswiki::OopsException( 59 59 'templatename', 60 60 web => 'webname', … … 66 66 sub test_redirectOopsException { 67 67 my $this = shift; 68 my $t = new TWiki();68 my $t = new Foswiki(); 69 69 my ($output, $result) = $this->capture(\&upchuck, $t); 70 70 $t->finish(); … … 75 75 sub test_AccessControlException { 76 76 my $this = shift; 77 my $ace = new TWiki::AccessControlException(77 my $ace = new Foswiki::AccessControlException( 78 78 'FRY', 79 79 'burger', … … 96 96 param4 => 'phlegm', 97 97 param5 => "the cat\nsat on\nthe rat"}); 98 my $session = new TWiki(undef, $query);99 my ($output, $result) = $this->capture(\& TWiki::UI::Oops::oops, $session,98 my $session = new Foswiki(undef, $query); 99 my ($output, $result) = $this->capture(\&Foswiki::UI::Oops::oops, $session, 100 100 "Flum", "DeDum", $query, 0); 101 101 $this->assert_matches(qr/^phlegm$/m, $output);
Note: See TracChangeset
for help on using the changeset viewer.
