Skip to content

Commit

Permalink
fix: tests and unused condition
Browse files Browse the repository at this point in the history
  • Loading branch information
ga-devfront committed Nov 6, 2024
1 parent 7c3a93b commit 5d473bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion classes/Task/Update/UpdateComplete.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function run(): int
$this->logger->debug('<strong>' . $this->translator->trans('Please remove %s by FTP', [$this->container->getFilePath()]) . '</strong>');
}

if ($this->container->getUpgradeConfiguration()->getChannel() != 'directory' && file_exists($this->container->getProperty(UpgradeContainer::LATEST_PATH)) && FilesystemAdapter::deleteDirectory($this->container->getProperty(UpgradeContainer::LATEST_PATH))) {
if (file_exists($this->container->getProperty(UpgradeContainer::LATEST_PATH)) && FilesystemAdapter::deleteDirectory($this->container->getProperty(UpgradeContainer::LATEST_PATH))) {
$this->logger->debug($this->translator->trans('%s removed', [$this->container->getProperty(UpgradeContainer::LATEST_PATH)]));
} elseif (is_dir($this->container->getProperty(UpgradeContainer::LATEST_PATH))) {
$this->logger->debug('<strong>' . $this->translator->trans('Please remove %s by FTP', [$this->container->getProperty(UpgradeContainer::LATEST_PATH)]) . '</strong>');
Expand Down
1 change: 1 addition & 0 deletions tests/unit/UpgradeContainer/FilesystemAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/

use PHPUnit\Framework\TestCase;
use PrestaShop\Module\AutoUpgrade\Parameters\UpgradeConfiguration;
use PrestaShop\Module\AutoUpgrade\UpgradeContainer;

class FilesystemAdapterTest extends TestCase
Expand Down

0 comments on commit 5d473bc

Please sign in to comment.