From 4be326aeeb73b82005eaf3fa3e475645a4cd9935 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 21 Nov 2023 14:57:52 +0100 Subject: [PATCH] Fix tests and CS --- src/Node/ModuleNode.php | 18 +++++++++--------- tests/Node/ModuleTest.php | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/src/Node/ModuleNode.php b/src/Node/ModuleNode.php index 0f4df35410f..9b485eeaf03 100644 --- a/src/Node/ModuleNode.php +++ b/src/Node/ModuleNode.php @@ -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 ') @@ -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')) @@ -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)))) diff --git a/tests/Node/ModuleTest.php b/tests/Node/ModuleTest.php index c036e3a71c1..938fa2ea7a2 100644 --- a/tests/Node/ModuleTest.php +++ b/tests/Node/ModuleTest.php @@ -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,); @@ -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,); @@ -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,);