Change tests to use the automatic backup of Settings in END blocks.
This commit is contained in:
parent
6f3aae261b
commit
4e78593395
23 changed files with 13 additions and 93 deletions
|
|
@ -28,12 +28,9 @@ my $node = WebGUI::Asset->getImportNode( $session );
|
|||
my @versionTags = ( WebGUI::VersionTag->getWorking( $session ) );
|
||||
|
||||
# Override some settings to make things easier to test
|
||||
my %oldSettings;
|
||||
# userFunctionStyleId
|
||||
$oldSettings{ userFunctionStyleId } = $session->setting->get( 'userFunctionStyleId' );
|
||||
$session->setting->set( 'userFunctionStyleId', 'PBtmpl0000000000000132' );
|
||||
# specialState
|
||||
$oldSettings{ specialState } = $session->setting->get( 'specialState' );
|
||||
$session->setting->set( 'specialState', '' );
|
||||
|
||||
# Create a user for testing purposes
|
||||
|
|
@ -120,10 +117,6 @@ END {
|
|||
}
|
||||
|
||||
$user->delete;
|
||||
|
||||
for my $key ( keys %oldSettings ) {
|
||||
$session->setting->set( $key, $oldSettings{ $key } );
|
||||
}
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -65,12 +65,9 @@ for my $i ( 0 .. 5 ) {
|
|||
$versionTag->commit;
|
||||
|
||||
# Override some settings to make things easier to test
|
||||
my %oldSettings;
|
||||
# userFunctionStyleId
|
||||
$oldSettings{ userFunctionStyleId } = $session->setting->get( 'userFunctionStyleId' );
|
||||
$session->setting->set( 'userFunctionStyleId', 'PBtmpl0000000000000132' );
|
||||
# specialState
|
||||
$oldSettings{ specialState } = $session->setting->get( 'specialState' );
|
||||
$session->setting->set( 'specialState', '' );
|
||||
|
||||
my ( $mech );
|
||||
|
|
@ -122,7 +119,4 @@ cmp_deeply(
|
|||
# Cleanup
|
||||
END {
|
||||
$versionTag->rollback();
|
||||
for my $key ( keys %oldSettings ) {
|
||||
$session->setting->set( $key, $oldSettings{ $key } );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue