From: <Cra...@nt...> - 2005-09-21 10:56:01
|
Author: CrawfordCurrie Date: 2005-09-21 03:55:44 -0700 (Wed, 21 Sep 2005) New Revision: 6494 Modified: twiki/branches/DEVELOP/test/unit/AccessControlTests.pm twiki/branches/DEVELOP/test/unit/TWikiTestCase.pm Log: Item108: tests needed to reset the twiki object to ensure cached topics got re-read Modified: twiki/branches/DEVELOP/test/unit/AccessControlTests.pm =================================================================== --- twiki/branches/DEVELOP/test/unit/AccessControlTests.pm 2005-09-21 10:47:02 UTC (rev 6493) +++ twiki/branches/DEVELOP/test/unit/AccessControlTests.pm 2005-09-21 10:55:44 UTC (rev 6494) @@ -37,14 +37,14 @@ $twiki->{store}->saveTopic($twiki->{user}, $TWiki::cfg{UsersWebName}, $TWiki::cfg{DefaultUserWikiName},''); - $MrWhite = $this->createFakeUser($twiki); - $MrBlue = $this->createFakeUser($twiki); - $MrOrange = $this->createFakeUser($twiki); - $MrGreen = $this->createFakeUser($twiki); - $MrYellow = $this->createFakeUser($twiki); + $MrWhite = $this->createFakeUser($twiki, '', "White"); + $MrBlue = $this->createFakeUser($twiki, '', "Blue"); + $MrOrange = $this->createFakeUser($twiki, '', "Orange"); + $MrGreen = $this->createFakeUser($twiki, '', "Green"); + $MrYellow = $this->createFakeUser($twiki, '', "Yellow"); $twiki->{store}->saveTopic( $currUser, $peopleWeb, "ReservoirDogsGroup", <<THIS - * Set GROUP=$MrWhite,$peopleWeb.$MrBlue + * Set GROUP = $MrWhite,$peopleWeb.$MrBlue THIS , undef); } @@ -80,10 +80,11 @@ <<THIS If DENYTOPIC is set to a list of wikinames * people in the list will be DENIED. -\t* Set DENYTOPICVIEW=$MrGreen - * Set DENYTOPICVIEW=$MrYellow,$peopleWeb.$MrOrange,%MAINWEB%.ReservoirDogsGroup +\t* Set DENYTOPICVIEW = $MrGreen + * Set DENYTOPICVIEW = $MrYellow,$peopleWeb.$MrOrange,%MAINWEB%.ReservoirDogsGroup THIS , undef); + $twiki = new TWiki(); $this->PERMITTED($testWeb,$testTopic,"VIEW",$MrGreen); $this->DENIED($testWeb,$testTopic,"VIEW",$MrYellow); @@ -102,6 +103,7 @@ * Set DENYTOPICVIEW= THIS , undef); + $twiki = new TWiki(); $this->PERMITTED($testWeb,$testTopic,"VIEW",$MrGreen); $this->PERMITTED($testWeb,$testTopic,"VIEW",$MrYellow); $this->PERMITTED($testWeb,$testTopic,"VIEW",$MrOrange); @@ -119,6 +121,7 @@ \t* Set ALLOWTOPICVIEW = %MAINWEB%.$MrOrange THIS , undef); + $twiki = new TWiki(); $this->PERMITTED($testWeb,$testTopic,"VIEW",$MrOrange); $this->DENIED($testWeb,$testTopic,"VIEW",$MrGreen); $this->DENIED($testWeb,$testTopic,"VIEW",$MrYellow); Modified: twiki/branches/DEVELOP/test/unit/TWikiTestCase.pm =================================================================== --- twiki/branches/DEVELOP/test/unit/TWikiTestCase.pm 2005-09-21 10:47:02 UTC (rev 6493) +++ twiki/branches/DEVELOP/test/unit/TWikiTestCase.pm 2005-09-21 10:55:44 UTC (rev 6494) @@ -92,9 +92,10 @@ # Only the user topic is created; the user is _not_ added to TWikiUsers. # The wikiname of the new user topic is returned. sub createFakeUser { - my( $this, $twiki, $text ) = @_; + my( $this, $twiki, $text, $name ) = @_; $this->assert($twiki->{store}->webExists($TWiki::cfg{UsersWebName})); - my $base = "TemporaryTestUser"; + $name ||= ''; + my $base = "TemporaryTestUser".$name; my $i = 0; while($twiki->{store}->topicExists($TWiki::cfg{UsersWebName},$base.$i)) { $i++; |