libresign/tests/php/Unit
Vitor Mattos 07a231aea2
fix: isolate PHP-pdftk dependency
I identified some issues with the follow log:

```
[PHP] Warning: include(): Failed opening '<redacted>/apps/richdocuments/vendor/composer/../mikehaertl/php-pdftk/src/Pdf.php' for inclusion (include_path='<redacted>/3rdparty/pear/archive_tar:/<redacted>/3rdparty/pear/console_getopt:<redacted>/3rdparty/pear/pear-core-minimal/src:/<redacted>/3rdparty/pear/pear_exception:/<redacted>/apps') at /<redacted>/lib/composer/composer/ClassLoader.php#576
	GET /ocs/v2.php/apps/libresign/api/v1/file/validate/file_id/2556
```

It's only occurr when use the app richdocuments, I saw that the package
mikehaertl/php-pdftk also is used by this app and because this the
autoload was mixed.

To solve this issue I used the package humbug/php-scoper that isolate
the dependency into a different namespace.

I also followed this article:

https://arthur-schiwon.de/isolating-nextcloud-app-dependencies-php-scoper

And the follow search results to see implementation examples:

https://github.com/search?q=OCA+path%3Ascoper.inc.php&type=code
https://github.com/search?q=org%3Anextcloud+path%3Ascoper.inc.php&type=code

Considering that we already have tests to cover the usage of pdftk,
isn't necessary to add new tests, if the test pass, this change worked
fine because loaded the isolated packages and the isolated packages made
the necessary.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-09-03 09:55:55 -03:00
..
Activity chore: move PHP tests to php folder 2025-05-21 09:07:42 -03:00
Controller chore: use newest method to get node by id 2025-08-20 09:10:36 -03:00
DataObjects chore: implement unit tests at visible elements class 2025-06-03 11:36:14 -03:00
Events chore: cover with tests and improve make class to be testable 2025-08-02 20:03:06 -03:00
Handler fix: isolate PHP-pdftk dependency 2025-09-03 09:55:55 -03:00
Helper fix: split errors 2025-08-20 09:10:37 -03:00
Middleware chore: implement Rector 2025-05-21 11:06:17 -03:00
Service fix: use UTC into all dates 2025-09-02 13:28:26 -03:00
Settings fix(tests): replace returnArgument with willReturnArgument in localization mocks 2025-08-11 01:59:26 +05:30
CapabilitiesTest.php chore: move PHP tests to php folder 2025-05-21 09:07:42 -03:00
TestCase.php fix: update mock constructor 2025-08-20 00:00:24 -03:00