web/tests/Utils/ApkSignUtilsTest.php
eater b3180f70e0
Some checks failed
continuous-integration/drone/push Build is failing
add corrupted jar and start working on jar signing parsing
2019-11-24 01:31:31 +01:00

25 lines
No EOL
755 B
PHP

<?php
namespace CubiStore\Tests\Web\Utils;
use CubiStore\Web\Utils\ApkSignUtils;
use PHPUnit\Framework\TestCase;
class ApkSignUtilsTest extends TestCase
{
function testCorruptedZip64() {
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage("Corrupted ZIP, ZIP64 offset and normal offset don't match up.");
$utils = new ApkSignUtils();
$utils->findSignature(__DIR__ . '/../../var/testdata/signedapks/zip64corrupted.jar');
}
function testSha1Signature()
{
$utils = new ApkSignUtils();
$apkSignature = $utils->findSignature(__DIR__ . '/../../var/testdata/signedapks/sha1.apk');
$this->assertNotNull($apkSignature, "Couldn't find APK signature");
}
}