Ignore:
Timestamp:
11/19/08 19:11:33 (4 years ago)
Author:
CrawfordCurrie
Message:

Item175: ported unit tests to new namespace. They all pass.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UnitTestContrib/test/unit/ExceptionTests.pm

    r14 r816  
    11package ExceptionTests; 
    2 use base TWikiTestCase; 
     2use base FoswikiTestCase; 
    33 
    44use strict; 
    55 
    66use Error qw( :try ); 
    7 use TWiki::OopsException; 
    8 use TWiki::UI::Oops; 
     7use Foswiki::OopsException; 
     8use Foswiki::UI::Oops; 
    99 
    1010# Check an OopsException with one non-array parameter 
     
    1212    my $this = shift; 
    1313    try { 
    14         throw TWiki::OopsException( 
     14        throw Foswiki::OopsException( 
    1515            'templatename', 
    1616            web => 'webname', 
     
    1919            keep => 1, 
    2020            params => 'phlegm'); 
    21     } catch TWiki::OopsException with { 
     21    } catch Foswiki::OopsException with { 
    2222        my $e = shift; 
    23         $this->assert($e->isa('TWiki::OopsException')); 
     23        $this->assert($e->isa('Foswiki::OopsException')); 
    2424        $this->assert_str_equals('webname', $e->{web}); 
    2525        $this->assert_str_equals('topicname', $e->{topic}); 
     
    3737    my $this = shift; 
    3838    try { 
    39         throw TWiki::OopsException( 
     39        throw Foswiki::OopsException( 
    4040            'templatename', 
    4141            web => 'webname', 
    4242            topic => 'topicname', 
    4343            params => [ 'phlegm', '<pus>' ]); 
    44     } catch TWiki::OopsException with { 
     44    } catch Foswiki::OopsException with { 
    4545        my $e = shift; 
    46         $this->assert($e->isa('TWiki::OopsException')); 
     46        $this->assert($e->isa('Foswiki::OopsException')); 
    4747        $this->assert_str_equals('webname', $e->{web}); 
    4848        $this->assert_str_equals('topicname', $e->{topic}); 
     
    5656sub upchuck { 
    5757    my $session = shift; 
    58     my $e = new TWiki::OopsException( 
     58    my $e = new Foswiki::OopsException( 
    5959            'templatename', 
    6060            web => 'webname', 
     
    6666sub test_redirectOopsException { 
    6767    my $this = shift; 
    68     my $t = new TWiki(); 
     68    my $t = new Foswiki(); 
    6969    my ($output, $result) = $this->capture(\&upchuck, $t); 
    7070    $t->finish(); 
     
    7575sub test_AccessControlException { 
    7676    my $this = shift; 
    77     my $ace = new TWiki::AccessControlException( 
     77    my $ace = new Foswiki::AccessControlException( 
    7878        'FRY', 
    7979        'burger', 
     
    9696        param4 => 'phlegm', 
    9797        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, 
    100100                   "Flum", "DeDum", $query, 0); 
    101101    $this->assert_matches(qr/^phlegm$/m, $output); 
Note: See TracChangeset for help on using the changeset viewer.