-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add unit testing capabilities for templates #23708
Conversation
* @param string $file | ||
* @param null $additionalParams |
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.
Only null? 😉
6838de7
to
4e99a90
Compare
$this->removeWhitespaces($actual); | ||
|
||
// $expectedHtml1 = preg_replace('~\s+~i', '', $expected->saveHTML()); | ||
// $actualHtml1 = preg_replace('~\s+~i', '', $actual->saveHTML()); |
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.
could be removed ;)
Code looks good and works 👍 |
* @param string $template | ||
* @param array $vars | ||
*/ | ||
protected function assertTemplate($expectedHtml, $template, $vars = []) { |
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.
Can't those methods live in tests/core/templates/templates.php
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.
I want to use this function in very app and all templates here in core - moving them into the base class made most sense to me - objections?
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.
Well my "objection" was that it is now available in all apps and tests. but I guess that is intended then, so fine
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.
so fine
is that a 👍 ❓
👍 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
With these changes unit testing templates can be done as easy as