Skip to content
Snippets Groups Projects
Commit 1c434913 authored by Ernesto Baschny's avatar Ernesto Baschny Committed by Anja Leichsenring
Browse files

[BUGFIX] Don't write LocalConfiguration on every Install Tool entry

Make removeObsoleteLocalConfigurationSettings only rewrite the
file if something has changed.

Resolves: #52437
Releases: 6.2
Change-Id: I014fa04659d1ca8435d576c85ab039a9ee0bf92b
Reviewed-on: https://review.typo3.org/24221
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
parent c3b73ce4
Branches
Tags
No related merge requests found
......@@ -252,7 +252,9 @@ class ConfigurationManager {
$localConfiguration = Utility\ArrayUtility::removeByPath($localConfiguration, $path);
}
}
$this->writeLocalConfiguration($localConfiguration);
if ($result) {
$this->writeLocalConfiguration($localConfiguration);
}
return $result;
}
......
......@@ -331,7 +331,27 @@ class ConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
$currentLocalConfiguration = array(
'notChanged' => 23,
);
$expectedConfiguration = array(
$this->createFixtureWithMockedMethods(
array(
'getLocalConfiguration',
'writeLocalConfiguration',
)
);
$this->fixture->expects($this->once())
->method('getLocalConfiguration')
->will($this->returnValue($currentLocalConfiguration));
$this->fixture->expects($this->never())
->method('writeLocalConfiguration');
$removeNothing = array();
$this->assertFalse($this->fixture->removeLocalConfigurationKeysByPath($removeNothing));
}
/**
* @test
*/
public function removeLocalConfigurationKeysByPathReturnsFalseIfSomethingInexistentIsRemoved() {
$currentLocalConfiguration = array(
'notChanged' => 23,
);
$this->createFixtureWithMockedMethods(
......@@ -343,12 +363,11 @@ class ConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
$this->fixture->expects($this->once())
->method('getLocalConfiguration')
->will($this->returnValue($currentLocalConfiguration));
$this->fixture->expects($this->once())
->method('writeLocalConfiguration')
->with($expectedConfiguration);
$this->fixture->expects($this->never())
->method('writeLocalConfiguration');
$removePaths = array();
$this->assertFalse($this->fixture->removeLocalConfigurationKeysByPath($removePaths));
$removeNonExisting = array('notPresent');
$this->assertFalse($this->fixture->removeLocalConfigurationKeysByPath($removeNonExisting));
}
/**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment