diff --git a/typo3/sysext/install/Classes/FolderStructure/AbstractNode.php b/typo3/sysext/install/Classes/FolderStructure/AbstractNode.php index b8b1a4396596feac339b6944e3d6dbb422d9aa67..89ee54f57d4e02cd80b353a3b3c019125f7651fc 100644 --- a/typo3/sysext/install/Classes/FolderStructure/AbstractNode.php +++ b/typo3/sysext/install/Classes/FolderStructure/AbstractNode.php @@ -144,9 +144,9 @@ abstract class AbstractNode protected function fixPermission(): FlashMessage { if ($this->isPermissionCorrect()) { - throw new Exception( - 'Permission on ' . $this->getAbsolutePath() . ' are already ok', - 1366744035 + return new FlashMessage( + '', + 'Permission on ' . $this->getAbsolutePath() . ' is already ok.' ); } $result = @chmod($this->getAbsolutePath(), (int)octdec($this->getTargetPermission())); diff --git a/typo3/sysext/install/Tests/Unit/FolderStructure/AbstractNodeTest.php b/typo3/sysext/install/Tests/Unit/FolderStructure/AbstractNodeTest.php index 58afce216278db56c88ed5a92aac01fc5fb1ff8e..ef6d24b0b11ec60efddc159ffa5721bcacb11076 100644 --- a/typo3/sysext/install/Tests/Unit/FolderStructure/AbstractNodeTest.php +++ b/typo3/sysext/install/Tests/Unit/FolderStructure/AbstractNodeTest.php @@ -23,7 +23,6 @@ use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\StringUtility; use TYPO3\CMS\Install\FolderStructure\AbstractNode; -use TYPO3\CMS\Install\FolderStructure\Exception; use TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException; use TYPO3\CMS\Install\FolderStructure\NodeInterface; use TYPO3\CMS\Install\FolderStructure\RootNodeInterface; @@ -134,7 +133,7 @@ final class AbstractNodeTest extends AbstractFolderStructureTestCase } #[Test] - public function fixPermissionThrowsExceptionIfPermissionAreAlreadyCorrect(): void + public function fixPermissionReturnsOkIfPermissionAreAlreadyCorrect(): void { $node = $this->getAccessibleMock( AbstractNode::class, @@ -143,11 +142,9 @@ final class AbstractNodeTest extends AbstractFolderStructureTestCase '', false ); - $this->expectException(Exception::class); - $this->expectExceptionCode(1366744035); $node->method('getAbsolutePath')->willReturn(''); $node->expects(self::once())->method('isPermissionCorrect')->willReturn(true); - $node->_call('fixPermission'); + self::assertEquals(ContextualFeedbackSeverity::OK, $node->_call('fixPermission')->getSeverity()); } #[Test]