Skip to content

Commit

Permalink
Fix tests and CS
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Nov 21, 2023
1 parent 9f42a76 commit 4be326a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Node/ModuleNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,9 @@ protected function compileMacros(Compiler $compiler)
protected function compileGetTemplateName(Compiler $compiler)
{
$compiler
->write("/**")
->write(" * @codeCoverageIgnore")
->write(" */")
->write("/**\n")
->write(" * @codeCoverageIgnore\n")
->write(" */\n")
->write("public function getTemplateName()\n", "{\n")
->indent()
->write('return ')
Expand Down Expand Up @@ -412,9 +412,9 @@ protected function compileIsTraitable(Compiler $compiler)
}

$compiler
->write("/**")
->write(" * @codeCoverageIgnore")
->write(" */")
->write("/**\n")
->write(" * @codeCoverageIgnore\n")
->write(" */\n")
->write("public function isTraitable()\n", "{\n")
->indent()
->write(sprintf("return %s;\n", $traitable ? 'true' : 'false'))
Expand All @@ -426,9 +426,9 @@ protected function compileIsTraitable(Compiler $compiler)
protected function compileDebugInfo(Compiler $compiler)
{
$compiler
->write("/**")
->write(" * @codeCoverageIgnore")
->write(" */")
->write("/**\n")
->write(" * @codeCoverageIgnore\n")
->write(" */\n")
->write("public function getDebugInfo()\n", "{\n")
->indent()
->write(sprintf("return %s;\n", str_replace("\n", '', var_export(array_reverse($compiler->getDebugInfo(), true), true))))
Expand Down
24 changes: 24 additions & 0 deletions tests/Node/ModuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,17 @@ protected function doDisplay(array \$context, array \$blocks = [])
echo "foo";
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "foo.twig";
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
return array ( 37 => 1,);
Expand Down Expand Up @@ -168,16 +174,25 @@ protected function doDisplay(array \$context, array \$blocks = [])
\$this->parent->display(\$context, array_merge(\$this->blocks, \$blocks));
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "foo.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable()
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
return array ( 43 => 1, 41 => 2, 34 => 1,);
Expand Down Expand Up @@ -248,16 +263,25 @@ protected function doDisplay(array \$context, array \$blocks = [])
\$this->getParent(\$context)->display(\$context, array_merge(\$this->blocks, \$blocks));
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "foo.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable()
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
return array ( 43 => 2, 41 => 4, 34 => 2,);
Expand Down

0 comments on commit 4be326a

Please sign in to comment.