Fix testing bugs

This commit is contained in:
Dennis Eichhorn 2018-10-14 22:28:21 +02:00
parent de7ef32dbb
commit 499cf41db2
3 changed files with 16 additions and 1 deletions

View File

@ -227,6 +227,10 @@ final class Directory extends FileAbstract implements DirectoryInterface
*/
public static function delete(string $path) : bool
{
if (empty($path)) {
return false;
}
$files = \scandir($path);
if ($files === false) {

View File

@ -34,6 +34,10 @@ class PackageManagerTest extends \PHPUnit\Framework\TestCase
\array_map('unlink', \glob(__DIR__ . '/testPackageExtracted/*'));
}
if (file_exists(__DIR__ . '/public.key')) {
unlink(__DIR__ . '/public.key');
}
// create keys
$alice_sign_kp = \sodium_crypto_sign_keypair();
@ -93,6 +97,7 @@ class PackageManagerTest extends \PHPUnit\Framework\TestCase
\file_get_contents(__DIR__ . '/public.key')
);
$package->extract(__DIR__ . '/testPackageExtracted');
$package->cleanup();
self::assertFalse(file_exists(__DIR__ . '/testPackage.zip'));
@ -107,6 +112,13 @@ class PackageManagerTest extends \PHPUnit\Framework\TestCase
if (file_exists(__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', '');
}
}

View File

@ -1 +0,0 @@
╨9  >К╤AMВ╙=ь║1б[▀QгШ5ОС b│ших3'{Яz0t╤=·пфuOzНФ┴⌡h