-
Notifications
You must be signed in to change notification settings - Fork 4
Add helper classes for shortcode testing #23
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
Conversation
…plain various testing approaches
MalteWunsch
left a comment
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.
Good job 💚
| /** | ||
| * @test | ||
| */ | ||
| public function resolve__placeholder_shortcode_in__twig(): void |
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've noticed these double underscores several times and wonder if I've missed some meaning?
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, somehow they keep reappearing when I run PHP-CS-Fixer.
| <service id="Thunder\Shortcode\Handler\PlaceholderHandler"> | ||
| <tag name="webfactory.shortcode" shortcode="placeholder" /> | ||
| </service> |
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'm not entirely happy for our tests to depend on this external PlaceholderHandler class. But it is officially mentioned in thunderer's README, so 👍
This PR addresses the shortcomings outlined in #12 and #13, and probably replaces #10 and #18 as well.
\Webfactory\ShortcodeBundle\Tests\Functional\ShortcodeTestclass.WebTestCase) and\Webfactory\ShortcodeBundle\Test\ShortcodeDefinitionTestHelperservice that can be used in Kernel-based (functional) tests to verify a given shortcode name is known, the controller can be resolved etc.\Webfactory\ShortcodeBundle\Test\EndToEndTestHelperclass that simplifies full end-to-end (from content to processed content) functional testing, including round-trips through Symfony's FragmentHandler for controller-based shortcodes.Fixes #12, fixes #13, closes #10, closes #18, closes #24.