From 1c1672f91ac4a4b2db744144ef4522eb9b65a1c7 Mon Sep 17 00:00:00 2001 From: Vadim Belman Date: Mon, 28 Nov 2016 21:20:25 -0500 Subject: [PATCH] Item13897: createNewFoswikiApp() is now initializing cfg using cfgParams --- UnitTestContrib/lib/Unit/FoswikiTestRole.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/UnitTestContrib/lib/Unit/FoswikiTestRole.pm b/UnitTestContrib/lib/Unit/FoswikiTestRole.pm index 54c5eee6c1..1db17294a5 100644 --- a/UnitTestContrib/lib/Unit/FoswikiTestRole.pm +++ b/UnitTestContrib/lib/Unit/FoswikiTestRole.pm @@ -617,7 +617,12 @@ sub createNewFoswikiApp { $app->cfg->data->{Store}{Implementation} ||= 'Foswiki::Store::PlainFile'; $params{env} //= $app->cloneEnv; - $params{cfg} //= $app->cfg->clone; + unless ( exists $params{cfgParams} ) { + my %cfgData = %{ $app->cfg->clone }; + delete $cfgData{app}; + $params{cfgParams} = \%cfgData; + } + my $newApp = Unit::TestApp->new(%params); $this->app($newApp);