Ignore:
Timestamp:
09/18/11 12:43:08 (20 months ago)
Author:
PaulHarvey
Message:

Item11135: wiring up the new store API - now the unit test infrastructure doesn't crash - next up, make some tests pass

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/scratch/UnitTestContrib/test/unit/PrefsTests.pm

    r8245 r12558  
    4444        my $webObject = Foswiki::Meta->new( $this->{session}, $TWiki::cfg{SystemWebName} ); 
    4545        $webObject->populateNewWeb($original); 
    46         my $m = 
    47           Foswiki::Meta->load( $this->{session}, $original, 
    48             $TWiki::cfg{SitePrefsTopicName} ); 
    49         $m->saveAs( $TWiki::cfg{SystemWebName}, 
    50             $TWiki::cfg{SitePrefsTopicName} ); 
     46 
     47        my $orig_sitepref = Foswiki::Store::load(address=>{web=>$original, topic=>$Foswiki::cfg{SitePrefsTopicName}}); 
     48        my $m = Foswiki::Store::create(address=>{web=>$TWiki::cfg{SystemWebName}, topic=>$Foswiki::cfg{SitePrefsTopicName}}, data=>{_text=>$orig_sitepref->text()}); 
     49        $m->save(); 
    5150    } 
    5251    catch Foswiki::AccessControlException with { 
     
    8079    my $user = $fatwilly->{user}; 
    8180    $this->assert_not_null($user); 
    82     my $topicObject = Foswiki::Meta->load( $fatwilly, $web, $topic ); 
     81    my $topicObject = Foswiki::Store::load(address=>{web=>$web, topic=>$topic}); 
     82 
    8383    my $text = $topicObject->text() || ''; 
    8484    $text =~ s/^\s*\* $type $pref =.*$//gm; 
Note: See TracChangeset for help on using the changeset viewer.