fix tests

This commit is contained in:
Dennis Eichhorn 2021-10-11 22:56:16 +02:00
parent 3d7586f385
commit 9d239ebd98
2 changed files with 6 additions and 6 deletions

View File

@ -97,11 +97,7 @@ final class ApplicationManager
$destination = \rtrim($destination, '\\/');
$source = \rtrim($source, '/\\');
if (!\is_dir(\dirname($destination))) {
Directory::create(\dirname($destination), 0755, true);
}
if (!\is_dir($source) || ($path = \realpath($destination)) === false
if (!\is_dir($source) || \is_dir($destination)
|| !\is_file($source . '/Admin/Installer.php')
) {
return false;
@ -114,6 +110,10 @@ final class ApplicationManager
$this->installFiles($source, $destination);
$this->replacePlaceholder($destination);
if (($path = \realpath($destination)) === false) {
return false; // @codeCoverageIgnore
}
$classPath = \substr($path . '/Admin/Installer', (int) \strlen((string) \realpath(__DIR__ . '/../../')));
// @var class-string<InstallerAbstract> $class

View File

@ -109,7 +109,7 @@ class ApplicationManagerTest extends \PHPUnit\Framework\TestCase
{
Directory::delete(__DIR__ . '/Apps/Testapp');
$this->appManager->install(__DIR__ . '/Testapp', __DIR__ . '/Apps/Testapp');
self::assertTrue($this->appManager->install(__DIR__ . '/Testapp', __DIR__ . '/Apps/Testapp'));
$this->appManager->reInit(__DIR__ . '/Apps/Testapp');
self::assertEquals($r1 = include __DIR__ . '/Testapp/Admin/Install/Application/Routes.php', $r2 = include __DIR__ . '/Apps/Testapp/Routes.php');