Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What should be done for version 1.84.2? #20

Open
3 of 4 tasks
alphp opened this issue Nov 2, 2022 · 8 comments
Open
3 of 4 tasks

What should be done for version 1.84.2? #20

alphp opened this issue Nov 2, 2022 · 8 comments
Labels
question Further information is requested
Milestone

Comments

@alphp
Copy link
Member

alphp commented Nov 2, 2022

In dev-master new features and scripts are being introduced, but the tags allow to define a stable point of the code.

composer require fawno/fpdf:@stable

What should be done for the 1.84.2 tag?

  • Documentation
  • Check the content of the pdf created in the tests
  • Must-have scripts
  • Other features

The essential documentation is almost complete, missing some pages that I would like to have to release the 1.84.2 tag.

@alphp alphp added the question Further information is requested label Nov 2, 2022
@alphp alphp added this to the 1.84.2 milestone Nov 2, 2022
@angeljqv
Copy link
Contributor

angeljqv commented Nov 7, 2022

Everything looks stable, release it 👍

@erikn69
Copy link
Contributor

erikn69 commented Nov 7, 2022

Maybe a way to test the pdf results instead of just the creation, FPDF can create the file but the result can be not as expected

Ideas:
https://gordonlesti.com/phpunit-compare-generated-pdf-files-with-imagick/
https://karlomikus.com/blog/compare-pdf-files-using-php-and-imagemagick
https://github.com/heiglandreas/pdfunit

UPDATE:
what do you think about erikn69@9d6cc34?
Maybe can work, but i'm not sure, since two equal texts are being compared, it could be prone to errors in case of changes in FPDF

@alphp
Copy link
Member Author

alphp commented Nov 7, 2022

Comparing the generated document in the tests instead of only if it is generated is one of the things that I have in the to-do.

@alphp
Copy link
Member Author

alphp commented Nov 7, 2022

Added generated pdf vs reference pdf check:
#22 Check the content of the pdf created in the tests

@dealfonso
Copy link

Maybe a way to test the pdf results instead of just the creation, FPDF can create the file but the result can be not as expected

Ideas: https://gordonlesti.com/phpunit-compare-generated-pdf-files-with-imagick/ https://karlomikus.com/blog/compare-pdf-files-using-php-and-imagemagick https://github.com/heiglandreas/pdfunit

UPDATE: what do you think about erikn69@9d6cc34? Maybe can work, but i'm not sure, since two equal texts are being compared, it could be prone to errors in case of changes in FPDF

So that you are using sapp, it would be possible to rebuild the pdf documents (for both to be flattened and the multiple versions of the objects are removed) and then use the compare function to get the objects that are different.

@angeljqv
Copy link
Contributor

angeljqv commented Nov 8, 2022

Creo q todos hablamos español aqui, o no es asi?

@erikn69
Copy link
Contributor

erikn69 commented Nov 8, 2022

Parece que si, pero se usa ingles para ayudar a la comprensión de personas no hispano parlantes

@parallels999
Copy link

parallels999 commented Nov 8, 2022

@dealfonso podrias agregar al readme.MD documentacion de como usar SAPP con PhpUnit para testear la generacion de PDFs(Talvez un trait para TestCase con los metodos listos para testear dos pdfs)

FPDF/tests/TestCase.php

Lines 46 to 59 in e8a8106

public function assertPdfAreEquals (string $expected, string $actual) : void {
$doc_expected = PDFDoc::from_string($expected);
$this->assertIsObject($doc_expected);
$doc_actual = PDFDoc::from_string($actual);
$this->assertIsObject($doc_actual);
$differences = $doc_expected->compare($doc_actual);
foreach ($differences as $oid => $obj) {
foreach ($obj->get_keys() as $key) {
$this->assertTrue(in_array($key, ['Producer', 'CreationDate']));
}
}
}

Y tambien a SAPP le falta el workflow con los tests, talvez a futuro se pueda agregar

@alphp alphp modified the milestones: 1.84.2, 1.84.3 Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants