- Timestamp:
- 01/25/12 10:32:32 (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CommentPlugin/test/unit/CommentPlugin/CommentPluginTests.pm
r13672 r13824 237 237 } 238 238 239 my $session = Foswiki->new( $Foswiki::cfg{DefaultUserLogin}, $query );239 $this->createNewFoswikiSession( $Foswiki::cfg{DefaultUserLogin}, $query ); 240 240 my $text = "Ignore this text"; 241 241 242 242 # invoke the save handler 243 $this->captureWithKey( rest => $this->getUIFn('rest'), $ session);243 $this->captureWithKey( rest => $this->getUIFn('rest'), $this->{session} ); 244 244 245 245 $text = Foswiki::Func::readTopicText( $web, $topic ); … … 483 483 $query->path_info("/CommentPlugin/comment"); 484 484 485 my $session = Foswiki->new( $Foswiki::cfg{DefaultUserLogin}, $query );485 $this->createNewFoswikiSession( $Foswiki::cfg{DefaultUserLogin}, $query ); 486 486 my $text = "Ignore this text"; 487 487 488 488 # invoke the save handler 489 $this->captureWithKey( rest => $this->getUIFn('rest'), $ session);489 $this->captureWithKey( rest => $this->getUIFn('rest'), $this->{session} ); 490 490 491 491 $text = … … 528 528 $query->path_info("/CommentPlugin/comment"); 529 529 530 my $session = Foswiki->new( $Foswiki::cfg{DefaultUserLogin}, $query );530 $this->createNewFoswikiSession( $Foswiki::cfg{DefaultUserLogin}, $query ); 531 531 my $text = "Ignore this text"; 532 532 533 533 # invoke the save handler 534 $this->captureWithKey( rest => $this->getUIFn('rest'), $ session);534 $this->captureWithKey( rest => $this->getUIFn('rest'), $this->{session} ); 535 535 536 536 $text = … … 596 596 $query->path_info("/CommentPlugin/comment"); 597 597 598 my $session = Foswiki->new( $Foswiki::cfg{DefaultUserLogin}, $query );598 $this->createNewFoswikiSession( $Foswiki::cfg{DefaultUserLogin}, $query ); 599 599 my $text = "Ignore this text"; 600 600 601 601 # invoke the save handler 602 $this->captureWithKey( rest => $this->getUIFn('rest'), $ session);602 $this->captureWithKey( rest => $this->getUIFn('rest'), $this->{session} ); 603 603 604 604 $text = … … 652 652 $query->path_info("/CommentPlugin/comment"); 653 653 654 my $session = Foswiki->new( $Foswiki::cfg{DefaultUserLogin}, $query );654 $this->createNewFoswikiSession( $Foswiki::cfg{DefaultUserLogin}, $query ); 655 655 my $text = "Ignore this text"; 656 656 657 657 # invoke the save handler 658 $this->captureWithKey( rest => $this->getUIFn('rest'), $ session);658 $this->captureWithKey( rest => $this->getUIFn('rest'), $this->{session} ); 659 659 660 660 $text = … … 704 704 $Foswiki::cfg{Plugins}{CommentPlugin}{RequiredForSave} = 'CHANGE'; 705 705 706 my ( $responseText, $result, $stdout, $stderr , $session);706 my ( $responseText, $result, $stdout, $stderr ); 707 707 708 708 # First make sure we can't *change* it 709 $ session = Foswiki->new( $Foswiki::cfg{DefaultUserLogin}, $query );709 $this->createNewFoswikiSession( $Foswiki::cfg{DefaultUserLogin}, $query ); 710 710 711 711 # invoke the save handler 712 712 eval { 713 ( $responseText, $result, $stdout, $stderr ) = 714 $this->captureWithKey( rest => $this->getUIFn('rest'), $session ); 713 ( $responseText, $result, $stdout, $stderr ) = $this->captureWithKey( 714 rest => $this->getUIFn('rest'), 715 $this->{session} 716 ); 715 717 }; 716 718 … … 721 723 $Foswiki::cfg{Plugins}{CommentPlugin}{RequiredForSave} = 'COMMENT'; 722 724 723 $ session = Foswiki->new( $Foswiki::cfg{DefaultUserLogin}, $query );725 $this->createNewFoswikiSession( $Foswiki::cfg{DefaultUserLogin}, $query ); 724 726 725 727 # invoke the save handler 726 728 eval { 727 ( $responseText, $result, $stdout, $stderr ) = 728 $this->captureWithKey( rest => $this->getUIFn('rest'), $session ); 729 ( $responseText, $result, $stdout, $stderr ) = $this->captureWithKey( 730 rest => $this->getUIFn('rest'), 731 $this->{session} 732 ); 729 733 }; 730 734 $this->assert( !$@ ); … … 768 772 $query->path_info("/CommentPlugin/comment"); 769 773 my ( $responseText, $result, $stdout, $stderr ); 770 my $session =$this->createNewFoswikiSession( undef, $query );774 $this->createNewFoswikiSession( undef, $query ); 771 775 eval { 772 ( $responseText, $result, $stdout, $stderr ) = 773 $this->captureWithKey( rest => $this->getUIFn('rest'), $session ); 776 ( $responseText, $result, $stdout, $stderr ) = $this->captureWithKey( 777 rest => $this->getUIFn('rest'), 778 $this->{session} 779 ); 774 780 }; 775 781 $this->assert_matches( qr/Status: 404/, $responseText ); … … 801 807 $query->path_info("/CommentPlugin/comment"); 802 808 803 my $session = Foswiki->new( $Foswiki::cfg{DefaultUserLogin}, $query );809 $this->createNewFoswikiSession( $Foswiki::cfg{DefaultUserLogin}, $query ); 804 810 my $text = "Ignore this text"; 805 811 … … 807 813 # $responseText, $result, $stdout, $stderr 808 814 my ( $response, $result, $stdout, $stderr ) = 809 $this->captureWithKey( rest => $this->getUIFn('rest'), $ session);815 $this->captureWithKey( rest => $this->getUIFn('rest'), $this->{session} ); 810 816 811 817 $this->assert_matches( qr/^Status: 302/ms, $response ); … … 878 884 $query->path_info("/CommentPlugin/comment"); 879 885 880 my $session = Foswiki->new( $Foswiki::cfg{DefaultUserLogin}, $query );886 $this->createNewFoswikiSession( $Foswiki::cfg{DefaultUserLogin}, $query ); 881 887 my $text = "Ignore this text"; 882 888 … … 884 890 # $responseText, $result, $stdout, $stderr 885 891 my ( $response, $result, $stdout, $stderr ) = 886 $this->captureWithKey( rest => $this->getUIFn('rest'), $ session);892 $this->captureWithKey( rest => $this->getUIFn('rest'), $this->{session} ); 887 893 888 894 $this->assert_matches( qr/^Status: 302/ms, $response );
Note: See TracChangeset
for help on using the changeset viewer.
