[stable32] refactor: consolidate pdf fixtures#6198
Merged
vitormattos merged 13 commits intostable32from Dec 15, 2025
Merged
Conversation
Consolidate PDF fixture generation into a single static class: - Migrate all methods from PdfFixtureTrait to PdfGenerator - Convert trait methods to public static methods - Maintain all existing functionality - Includes 20+ methods for ISO 32000-1 edge case testing This improves code organization and eliminates trait usage. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Delete trait after migrating all methods to PdfGenerator. The trait pattern was unnecessary for stateless utility methods. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Replace PdfFixtureTrait usage with PdfGenerator static methods: - Remove 'use PdfFixtureTrait' statements - Add 'use OCA\Libresign\Tests\Fixtures\PdfGenerator' imports - Change trait method calls to static PdfGenerator:: calls - Fix incorrect PdfGenerator::createMock() to $this->createMock() Affected test files: - DocMdpHandlerTest - FileServiceTest (3 createMock fixes) - SignFileServiceTest (20+ createMock fixes) - PdfParseServiceTest - PdfSignatureDetectionServiceTest - RequestSignatureServiceTest - ValidateHelperTest - AEnvironmentPageAwareControllerTest Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Replace PdfFixtureTrait with PdfGenerator in API tests: - FileControllerTest - FileElementControllerTest - IdDocsControllerTest - NotifyControllerTest - RequestSignatureControllerTest - SignFileControllerTest Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Clean up test code by: - Removing verbose docblocks and obvious comments - Simplifying assertion messages - Deleting 2 redundant tests (extraction and validation) - Reducing file size from 180 to 46 lines (74% reduction) All 21 tests still pass with maintained coverage. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Create catalog system for managing real-world signed PDFs: - PdfFixtureCatalog class with YAML-based metadata - Filter by DocMDP level, TSA, signature tool, count - Provides expected validation results for tests - Includes PdfFixture wrapper for easy access - Store real PDFs in tests/php/fixtures/pdfs/ directory Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Delete PDFs from root fixtures directory. Files now organized in tests/php/fixtures/pdfs/ with catalog. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Update composer.json and Pkcs12Handler changes from refactoring. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Add SPDX license and copyright headers to comply with REUSE specification. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Update path from tests/php/fixtures/small_valid.pdf to tests/php/fixtures/pdfs/small_valid.pdf after file reorganization. Fixes /apps/libresign/develop/pdf route. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Update paths to reflect new organization in pdfs/ subdirectory: - tests/php/fixtures/real_jsignpdf_level1.pdf -> tests/php/fixtures/pdfs/real_jsignpdf_level1.pdf - tests/php/fixtures/small_valid-signed.pdf -> tests/php/fixtures/pdfs/small_valid-signed.pdf - tests/php/fixtures/small_valid.pdf -> tests/php/fixtures/pdfs/small_valid.pdf Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of PR #6197