mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-06 20:48:40 +00:00
fix tests
This commit is contained in:
parent
3d7586f385
commit
9d239ebd98
|
|
@ -97,11 +97,7 @@ final class ApplicationManager
|
||||||
$destination = \rtrim($destination, '\\/');
|
$destination = \rtrim($destination, '\\/');
|
||||||
$source = \rtrim($source, '/\\');
|
$source = \rtrim($source, '/\\');
|
||||||
|
|
||||||
if (!\is_dir(\dirname($destination))) {
|
if (!\is_dir($source) || \is_dir($destination)
|
||||||
Directory::create(\dirname($destination), 0755, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!\is_dir($source) || ($path = \realpath($destination)) === false
|
|
||||||
|| !\is_file($source . '/Admin/Installer.php')
|
|| !\is_file($source . '/Admin/Installer.php')
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -114,6 +110,10 @@ final class ApplicationManager
|
||||||
$this->installFiles($source, $destination);
|
$this->installFiles($source, $destination);
|
||||||
$this->replacePlaceholder($destination);
|
$this->replacePlaceholder($destination);
|
||||||
|
|
||||||
|
if (($path = \realpath($destination)) === false) {
|
||||||
|
return false; // @codeCoverageIgnore
|
||||||
|
}
|
||||||
|
|
||||||
$classPath = \substr($path . '/Admin/Installer', (int) \strlen((string) \realpath(__DIR__ . '/../../')));
|
$classPath = \substr($path . '/Admin/Installer', (int) \strlen((string) \realpath(__DIR__ . '/../../')));
|
||||||
|
|
||||||
// @var class-string<InstallerAbstract> $class
|
// @var class-string<InstallerAbstract> $class
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ class ApplicationManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
{
|
{
|
||||||
Directory::delete(__DIR__ . '/Apps/Testapp');
|
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');
|
$this->appManager->reInit(__DIR__ . '/Apps/Testapp');
|
||||||
self::assertEquals($r1 = include __DIR__ . '/Testapp/Admin/Install/Application/Routes.php', $r2 = include __DIR__ . '/Apps/Testapp/Routes.php');
|
self::assertEquals($r1 = include __DIR__ . '/Testapp/Admin/Install/Application/Routes.php', $r2 = include __DIR__ . '/Apps/Testapp/Routes.php');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user