- Timestamp:
- 11/19/08 15:00:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CommentPlugin/test/unit/CommentPlugin/CommentPluginTests.pm
r14 r811 8 8 use Unit::Request; 9 9 use Unit::Response; 10 use TWiki;11 use TWiki::UI::Save;12 use TWiki::Plugins::CommentPlugin;13 use TWiki::Plugins::CommentPlugin::Comment;10 use Foswiki; 11 use Foswiki::UI::Save; 12 use Foswiki::Plugins::CommentPlugin; 13 use Foswiki::Plugins::CommentPlugin::Comment; 14 14 use CGI; 15 15 … … 34 34 sub writeTopic { 35 35 my( $this, $web, $topic, $text ) = @_; 36 my $meta = new TWiki::Meta($this->{twiki}, $web, $topic);36 my $meta = new Foswiki::Meta($this->{twiki}, $web, $topic); 37 37 $this->{twiki}->{store}->saveTopic( 38 38 $this->{twiki}->{user}, $web, $topic, $text, $meta ); … … 69 69 } 70 70 71 my $url = "$ TWiki::cfg{DefaultUrlHost}$TWiki::cfg{ScriptUrlPath}/save$TWiki::cfg{ScriptSuffix}/$web/$topic";71 my $url = "$Foswiki::cfg{DefaultUrlHost}$Foswiki::cfg{ScriptUrlPath}/save$Foswiki::cfg{ScriptSuffix}/$web/$topic"; 72 72 73 73 if ( $location ) { … … 103 103 my $pidx = $eidx; 104 104 my $html = 105 TWiki::Plugins::CommentPlugin::Comment::_handleInput(105 Foswiki::Plugins::CommentPlugin::Comment::_handleInput( 106 106 $sattrs, 107 107 $this->{test_web}, … … 196 196 } 197 197 198 my $session = new TWiki( $TWiki::cfg{DefaultUserLoginName}, $query);198 my $session = new Foswiki( $Foswiki::cfg{DefaultUserLoginName}, $query); 199 199 my $text = "Ignore this text"; 200 200 201 201 # invoke the save handler 202 $this->capture(\& TWiki::UI::Save::save, $session );203 204 $text = TWiki::Func::readTopicText($web, $topic);202 $this->capture(\&Foswiki::UI::Save::save, $session ); 203 204 $text = Foswiki::Func::readTopicText($web, $topic); 205 205 $this->assert_matches(qr/$comm/, $text, "$web.$topic: $text"); 206 206 … … 278 278 my $pidx = 0; 279 279 my $html = 280 TWiki::Plugins::CommentPlugin::Comment::_handleInput280 Foswiki::Plugins::CommentPlugin::Comment::_handleInput 281 281 ("rows=99 cols=104 mode=after button=HoHo id=sausage",, 282 282 $this->{test_topic}, … … 296 296 my $pidx = 0; 297 297 my $html = 298 TWiki::Plugins::CommentPlugin::Comment::_handleInput298 Foswiki::Plugins::CommentPlugin::Comment::_handleInput 299 299 ("target=\"$this->{test_web}.ATopic#AAnchor\" location=\"AnRE\"", 300 300 $this->{test_topic}, … … 318 318 my $pidx = 0; 319 319 my $html = 320 TWiki::Plugins::CommentPlugin::Comment::_handleInput(320 Foswiki::Plugins::CommentPlugin::Comment::_handleInput( 321 321 'nopost="on"', 322 322 $this->{test_web}, … … 339 339 $query->path_info("/$this->{test_web}/$this->{test_topic}"); 340 340 341 my $session = new TWiki( $TWiki::cfg{DefaultUserLoginName}, $query);341 my $session = new Foswiki( $Foswiki::cfg{DefaultUserLoginName}, $query); 342 342 my $text = "Ignore this text"; 343 343 344 344 # invoke the save handler 345 $this->capture(\& TWiki::UI::Save::save, $session );346 347 $text = TWiki::Func::readTopicText($this->{test_web}, $this->{test_topic});345 $this->capture(\&Foswiki::UI::Save::save, $session ); 346 347 $text = Foswiki::Func::readTopicText($this->{test_web}, $this->{test_topic}); 348 348 # make sure it hasn't changed 349 349 $text =~ s/^%META.*?\n//gm; … … 362 362 my $pidx = 99; 363 363 my $html = 364 TWiki::Plugins::CommentPlugin::Comment::_handleInput(364 Foswiki::Plugins::CommentPlugin::Comment::_handleInput( 365 365 'remove="on"', 366 366 $this->{test_web}, … … 384 384 $query->path_info("/$this->{test_web}/$this->{test_topic}"); 385 385 386 my $session = new TWiki( $TWiki::cfg{DefaultUserLoginName}, $query);386 my $session = new Foswiki( $Foswiki::cfg{DefaultUserLoginName}, $query); 387 387 my $text = "Ignore this text"; 388 388 389 389 # invoke the save handler 390 $this->capture(\& TWiki::UI::Save::save, $session );391 392 $text = TWiki::Func::readTopicText($this->{test_web}, $this->{test_topic});390 $this->capture(\&Foswiki::UI::Save::save, $session ); 391 392 $text = Foswiki::Func::readTopicText($this->{test_web}, $this->{test_topic}); 393 393 # make sure it hasn't changed 394 394 $text =~ s/^%META.*?\n//gm; … … 411 411 my $pidx = 99; 412 412 my $html = 413 TWiki::Plugins::CommentPlugin::Comment::_handleInput(413 Foswiki::Plugins::CommentPlugin::Comment::_handleInput( 414 414 'default="wibble"', 415 415 $this->{test_web},
Note: See TracChangeset
for help on using the changeset viewer.
