Skip to content

Conversation

@enboig
Copy link

@enboig enboig commented Jun 26, 2023

This way you can add multiple input files and they will be merged in output file.

@DaanDeSmedt
Copy link
Owner

DaanDeSmedt commented Jun 27, 2023

@enboig - thanks for the addition! 👍

It would be fantastic in order to complete the PR, to foresee :

  • public function getInputFile() : string - should also reflect the multiple files change
  • add a test to ensure multiple files integrity
  • update README.md to reflect files list (merge)

@enboig
Copy link
Author

enboig commented Jun 27, 2023

How are tests run?
I tried

$ phpunit tests/PHPGhostscript/PHPGhostscriptTest.php 
PHP Fatal error:  PHPUnit\TextUI\RuntimeException cannot implement PHPUnit\TextUI\Exception - it is not an interface in /usr/share/php/PHPUnit/TextUI/Exception/RuntimeException.php on line 15
PHP Stack trace:
PHP   1. {main}() /usr/bin/phpunit:0
PHP   2. PHPUnit\TextUI\Command::main($exit = *uninitialized*) /usr/bin/phpunit:73
PHP   3. {closure:/usr/share/php/PHPUnit/Autoload.php:32-389}($class = 'PHPUnit\\TextUI\\RuntimeException') /usr/share/php/PHPUnit/TextUI/Command.php:98
PHP   4. require() /usr/share/php/PHPUnit/Autoload.php:387

@DaanDeSmedt
Copy link
Owner

From within the PHPGhostscript package directory (where the composer.json is located) you can use most basic command phpunit.

The PHPUnit configuration is stored in the phpunit.xml file.

Fore more in-depths, have a look at :

@enboig
Copy link
Author

enboig commented Jun 27, 2023

Done, I had some problems with gs path (I am using linux).

I changed tests to work on my environment, and undid them before commiting.

+ changed `getInputFile` to `getInputFiles`
+ added `clearInputFiles` to reset input file list
+ added test for `clearInputFiles`
+ small tweaks on `testInputFiles`
@DaanDeSmedt DaanDeSmedt merged commit 593ca09 into DaanDeSmedt:master Jun 29, 2023
@enboig
Copy link
Author

enboig commented Jun 30, 2023

I was reticent to change getInputFile() to getInputFiles() for backward compatibility; but as soon as it change return type from string to array it was broken.

Thanks for committing the change.

@DaanDeSmedt
Copy link
Owner

DaanDeSmedt commented Jun 30, 2023

I've merged and release a 1.1 version including your contributions - and mitigate the getInputFiles() change.

Since the filelist is now a collection, it didn't make much sense to keep compatibility but not respecting the return as a collection.

Thanks for the merge feature 👍!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants