You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
web/tests/Utils/ApkSignUtilsTest.php

25 lines
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");
}
}