mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-11 22:38:42 +00:00
Fix testing bugs
This commit is contained in:
parent
de7ef32dbb
commit
499cf41db2
|
|
@ -227,6 +227,10 @@ final class Directory extends FileAbstract implements DirectoryInterface
|
||||||
*/
|
*/
|
||||||
public static function delete(string $path) : bool
|
public static function delete(string $path) : bool
|
||||||
{
|
{
|
||||||
|
if (empty($path)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$files = \scandir($path);
|
$files = \scandir($path);
|
||||||
|
|
||||||
if ($files === false) {
|
if ($files === false) {
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,10 @@ class PackageManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
\array_map('unlink', \glob(__DIR__ . '/testPackageExtracted/*'));
|
\array_map('unlink', \glob(__DIR__ . '/testPackageExtracted/*'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (file_exists(__DIR__ . '/public.key')) {
|
||||||
|
unlink(__DIR__ . '/public.key');
|
||||||
|
}
|
||||||
|
|
||||||
// create keys
|
// create keys
|
||||||
$alice_sign_kp = \sodium_crypto_sign_keypair();
|
$alice_sign_kp = \sodium_crypto_sign_keypair();
|
||||||
|
|
||||||
|
|
@ -93,6 +97,7 @@ class PackageManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
\file_get_contents(__DIR__ . '/public.key')
|
\file_get_contents(__DIR__ . '/public.key')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$package->extract(__DIR__ . '/testPackageExtracted');
|
||||||
$package->cleanup();
|
$package->cleanup();
|
||||||
|
|
||||||
self::assertFalse(file_exists(__DIR__ . '/testPackage.zip'));
|
self::assertFalse(file_exists(__DIR__ . '/testPackage.zip'));
|
||||||
|
|
@ -107,6 +112,13 @@ class PackageManagerTest extends \PHPUnit\Framework\TestCase
|
||||||
|
|
||||||
if (file_exists(__DIR__ . '/testPackageExtracted')) {
|
if (file_exists(__DIR__ . '/testPackageExtracted')) {
|
||||||
\array_map('unlink', \glob(__DIR__ . '/testPackageExtracted/*'));
|
\array_map('unlink', \glob(__DIR__ . '/testPackageExtracted/*'));
|
||||||
|
\rmdir(__DIR__ . '/testPackageExtracted');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (file_exists(__DIR__ . '/public.key')) {
|
||||||
|
unlink(__DIR__ . '/public.key');
|
||||||
|
}
|
||||||
|
|
||||||
|
file_put_contents(__DIR__ . '/testPackage/package.cert', '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
╨9>К╤AMВ╙=ь║1б[▀QгШ5О╗С b│ших3'{■Яz0t╤=·пфuOzНФ┴⌡h
|
|
||||||
Loading…
Reference in New Issue
Block a user