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

Load custom templates now working (via #37) #114

Closed
wants to merge 8 commits into from

Conversation

PurHur
Copy link
Collaborator

@PurHur PurHur commented Jul 14, 2019

This is the merged and fixed pull request #37. (#32)

To load a custom twig template you can define the path and the file via your behat configuration:

      render_options:
        twig_template_name: report.twig
        twig_template_path: templates/

@PurHur PurHur requested a review from donkidd July 14, 2019 06:50
@donkidd
Copy link
Collaborator

donkidd commented Jul 14, 2019

Should we start building & using tests in the classes?

@donkidd
Copy link
Collaborator

donkidd commented Jul 14, 2019

Can you add some documentation to the README.md file about this new template feature?

@PurHur
Copy link
Collaborator Author

PurHur commented Jul 14, 2019

We should
And im gonna rework the readme

Copy link
Collaborator

@donkidd donkidd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a few questions an comments and added mention of about updating the readme file.

$className = __NAMESPACE__.'\\'.$renderer.'Renderer';
} else {
$className = $renderer;
foreach ($rendererList as $r) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably have a better variable name than r in this loop.

Suggested change
foreach ($rendererList as $r) {
foreach ($rendererList as $renderer) {

@@ -25,22 +25,22 @@ class BaseRenderer
* @param string : list of the renderer
* @param string : base_path
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably change to reference render_option instead of base_path

@@ -176,14 +176,14 @@ class BehatHTMLFormatter implements Formatter
* @param $name
* @param $base_path
*/
public function __construct($name, $renderer, $filename, $print_args, $print_outp, $loop_break, $base_path)
public function __construct($name, $renderer, $render_options, $filename, $print_args, $print_outp, $loop_break, $base_path)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By putting $render_options as the 3rd parameter does that make this a breaking change for anyone who has instantiated this class?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess after all the time there will be some breaking changes in a lot of diffrent code bases. But we can move that.

src/Renderer/TwigRenderer.php Show resolved Hide resolved
@PurHur
Copy link
Collaborator Author

PurHur commented Dec 12, 2023

I will reimplement this feature in the next time with a fresh and clean PR

@PurHur PurHur closed this Dec 12, 2023
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.

2 participants