chore: fix tests after move files

Signed-off-by: Vitor Mattos <vitor@php.rio>
This commit is contained in:
Vitor Mattos 2025-05-21 09:08:40 -03:00
parent 655cee2534
commit fb1e7f5249
No known key found for this signature in database
GPG key ID: B7AB4B76A7CA7318
7 changed files with 25 additions and 24 deletions

View file

@ -37,15 +37,15 @@ path = [
"openapi.json",
"package-lock.json",
"package.json",
"phpunit.xml",
"tests/php/phpunit.xml",
"psalm.xml",
"src/types/openapi/openapi-administration.ts",
"src/types/openapi/openapi-full.ts",
"src/types/openapi/openapi.ts",
"tests/Unit/Handler/mock/cert.json",
"tests/fixtures/cfssl/newcert-with-success.json",
"tests/fixtures/small_valid-signed.pdf",
"tests/fixtures/small_valid.pdf",
"tests/php/Unit/Handler/mock/cert.json",
"tests/php/fixtures/cfssl/newcert-with-success.json",
"tests/php/fixtures/small_valid-signed.pdf",
"tests/php/fixtures/small_valid.pdf",
"tests/integration/composer.json",
"tests/integration/composer.lock",
"tests/integration/features/**/*.feature",

View file

@ -48,7 +48,7 @@ class DevelopController extends Controller {
if (!$this->isDebugMode()) {
return new DataResponse([], Http::STATUS_NOT_FOUND);
}
$file = new InMemoryFile('file.pdf', file_get_contents(__DIR__ . '/../../tests/fixtures/small_valid.pdf'));
$file = new InMemoryFile('file.pdf', file_get_contents(__DIR__ . '/../../tests/php/fixtures/small_valid.pdf'));
$response = new FileDisplayResponse($file);
$response->setHeaders([
'Content-Disposition' => 'inline; filename="file.pdf"',

View file

@ -147,7 +147,7 @@ final class JSignPdfHandlerTest extends \OCA\Libresign\Tests\Unit\TestCase {
);
$this->signatureBackgroundService->method('getImagePath')->willReturn(
realpath(__DIR__ . '/../../../../img/LibreSign.png')
realpath(__DIR__ . '/../../../../../img/LibreSign.png')
);
$this->appConfig->setValueFloat('libresign', 'template_font_size', $templateFontSize);
@ -199,7 +199,7 @@ final class JSignPdfHandlerTest extends \OCA\Libresign\Tests\Unit\TestCase {
'lly' => 0,
'urx' => 0,
'ury' => 0,
], realpath(__DIR__ . '/../../../../img/app-dark.png'))],
], realpath(__DIR__ . '/../../../../../img/app-dark.png'))],
'signatureWidth' => 100,
'signatureHeight' => 100,
'template' => '',
@ -217,7 +217,7 @@ final class JSignPdfHandlerTest extends \OCA\Libresign\Tests\Unit\TestCase {
'lly' => 20,
'urx' => 30,
'ury' => 40,
], realpath(__DIR__ . '/../../../../img/app-dark.png'))],
], realpath(__DIR__ . '/../../../../../img/app-dark.png'))],
'signatureWidth' => 20,
'signatureHeight' => 20,
'template' => '',
@ -235,7 +235,7 @@ final class JSignPdfHandlerTest extends \OCA\Libresign\Tests\Unit\TestCase {
'lly' => 20,
'urx' => 30,
'ury' => 40,
], realpath(__DIR__ . '/../../../../img/app-dark.png'))],
], realpath(__DIR__ . '/../../../../../img/app-dark.png'))],
'signatureWidth' => 20,
'signatureHeight' => 20,
'template' => 'aaaaa',
@ -253,7 +253,7 @@ final class JSignPdfHandlerTest extends \OCA\Libresign\Tests\Unit\TestCase {
'lly' => 20,
'urx' => 30,
'ury' => 40,
], realpath(__DIR__ . '/../../../../img/app-dark.png'))],
], realpath(__DIR__ . '/../../../../../img/app-dark.png'))],
'signatureWidth' => 20,
'signatureHeight' => 20,
'template' => 'aaaaa',
@ -271,7 +271,7 @@ final class JSignPdfHandlerTest extends \OCA\Libresign\Tests\Unit\TestCase {
'lly' => 20,
'urx' => 30,
'ury' => 40,
], realpath(__DIR__ . '/../../../../img/app-dark.png'))],
], realpath(__DIR__ . '/../../../../../img/app-dark.png'))],
'signatureWidth' => 20,
'signatureHeight' => 20,
'template' => 'aaaaa',
@ -289,7 +289,7 @@ final class JSignPdfHandlerTest extends \OCA\Libresign\Tests\Unit\TestCase {
'lly' => 20,
'urx' => 30,
'ury' => 40,
], realpath(__DIR__ . '/../../../../img/app-dark.png'))],
], realpath(__DIR__ . '/../../../../../img/app-dark.png'))],
'signatureWidth' => 20,
'signatureHeight' => 20,
'template' => 'aaaaa',
@ -307,7 +307,7 @@ final class JSignPdfHandlerTest extends \OCA\Libresign\Tests\Unit\TestCase {
'lly' => 100,
'urx' => 351,
'ury' => 200,
], realpath(__DIR__ . '/../../../../img/app-dark.png'))],
], realpath(__DIR__ . '/../../../../../img/app-dark.png'))],
'signatureWidth' => 350,
'signatureHeight' => 100,
'template' => 'aaaaa',
@ -325,7 +325,7 @@ final class JSignPdfHandlerTest extends \OCA\Libresign\Tests\Unit\TestCase {
'lly' => 20,
'urx' => 30,
'ury' => 40,
], realpath(__DIR__ . '/../../../../img/app-dark.png'))],
], realpath(__DIR__ . '/../../../../../img/app-dark.png'))],
'signatureWidth' => 20,
'signatureHeight' => 20,
'template' => 'aaaaa',
@ -361,7 +361,7 @@ final class JSignPdfHandlerTest extends \OCA\Libresign\Tests\Unit\TestCase {
'lly' => 20,
'urx' => 30,
'ury' => 40,
], realpath(__DIR__ . '/../../../../img/app-dark.png'))],
], realpath(__DIR__ . '/../../../../../img/app-dark.png'))],
'signatureWidth' => 20,
'signatureHeight' => 20,
'template' => '',

View file

@ -91,7 +91,7 @@ final class PdfParseServiceTest extends \OCA\Libresign\Tests\Unit\TestCase {
return [
[
'disablePdfInfo' => true,
'tests/fixtures/small_valid.pdf',
'tests/php/fixtures/small_valid.pdf',
[
'p' => 1,
'd' => [
@ -101,7 +101,7 @@ final class PdfParseServiceTest extends \OCA\Libresign\Tests\Unit\TestCase {
],
[
'disablePdfInfo' => true,
'tests/fixtures/small_valid-signed.pdf',
'tests/php/fixtures/small_valid-signed.pdf',
[
'p' => 1,
'd' => [
@ -111,7 +111,7 @@ final class PdfParseServiceTest extends \OCA\Libresign\Tests\Unit\TestCase {
],
[
'disablePdfInfo' => false,
'tests/fixtures/small_valid.pdf',
'tests/php/fixtures/small_valid.pdf',
[
'p' => 1,
'd' => [
@ -121,7 +121,7 @@ final class PdfParseServiceTest extends \OCA\Libresign\Tests\Unit\TestCase {
],
[
'disablePdfInfo' => false,
'tests/fixtures/small_valid-signed.pdf',
'tests/php/fixtures/small_valid-signed.pdf',
[
'p' => 1,
'd' => [

View file

@ -15,10 +15,11 @@ if (!defined('PHPUNIT_RUN')) {
}
require_once __DIR__ . '/../../../../lib/base.php';
require_once __DIR__ . '/../../vendor/autoload.php';
require_once __DIR__ . '/../../../../tests/autoload.php';
\OC::$composerAutoloader->addPsr4('Test\\', OC::$SERVERROOT . '/tests/php/lib/', true);
\OC::$composerAutoloader->addPsr4('Tests\\', OC::$SERVERROOT . '/tests/php/', true);
\OC::$composerAutoloader->addPsr4('OCA\\Libresign\\Tests\\', __DIR__, true);
Server::get(IAppManager::class)->loadApp('libresign');

View file

@ -7,7 +7,7 @@
failOnRisky="true"
failOnWarning="true"
colors="true"
cacheDirectory="build/logs/.phpunit.cache"
cacheDirectory="../../build/logs/.phpunit.cache"
displayDetailsOnTestsThatTriggerWarnings="true"
beStrictAboutCoverageMetadata="true">
<testsuites>
@ -20,8 +20,8 @@
</testsuites>
<coverage>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/logs/html-coverage" lowUpperBound="50" highLowerBound="90"/>
<clover outputFile="../../build/logs/clover.xml"/>
<html outputDirectory="../../build/logs/html-coverage" lowUpperBound="50" highLowerBound="90"/>
</report>
</coverage>
<source>