-
Notifications
You must be signed in to change notification settings - Fork 4
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
[UPDATE] Better tests #52
Conversation
Neirda24
commented
May 30, 2024
- Fix risky tests
- Add more tests
- Fix issue with int / float parsing with Units
@@ -535,8 +535,8 @@ private function addConfiguration(string $configurationName, mixed $value): void | |||
'single_page' => $this->singlePage($value), | |||
'pdf_format' => $this->pdfFormat(PdfFormat::from($value)), | |||
'pdf_universal_access' => $this->pdfUniversalAccess($value), | |||
'paper_width' => $this->paperWidth($value), | |||
'paper_height' => $this->paperHeight($value), | |||
'paper_width' => $splitAndParseStringWithUnit($value, $this->paperWidth(...)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about a Util/UnitParser
with static methods. We could also test it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems a bit much for just one usecase ? It is indirectly tested already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are units used in with LibreOffice? If so, this util could be useful.
If not, let's keep it that way!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to check...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done with tests
|
||
protected function setUp(): void | ||
{ | ||
self::$gotenbergClient = $this->createMock(GotenbergClientInterface::class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this variable static ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no reasons... habits I guess. Will change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
$builder->header('templates/invalid.html.twig'); | ||
} | ||
|
||
private function getChromiumPdfBuilder(false|null $twig = null): AbstractChromiumPdfBuilder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
false|null $twig = null
=> bool $injectTwig = true
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup. Don't know why I didn't went that way...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done