jenkins-bot has submitted this change and it was merged.

Change subject: Hygiene: Dont save phpunit handlebars compilations
......................................................................


Hygiene: Dont save phpunit handlebars compilations

The original method used to compile templates in this test
results in leaving behind new compiled files in handlebars/compiled
that were never before created(due to being used as a partial instead
of directly).

This patch adjusts to create and evaluate the template on the spot rather
than writing it out.

Change-Id: I7dadd551a5340c8a9ad615a23d4e7bd8bfe2bf65
---
M tests/phpunit/Handlebars/FlowPostMetaActionsTest.php
1 file changed, 7 insertions(+), 4 deletions(-)

Approvals:
  Matthias Mullie: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/phpunit/Handlebars/FlowPostMetaActionsTest.php 
b/tests/phpunit/Handlebars/FlowPostMetaActionsTest.php
index 0af4fef..8e8c778 100644
--- a/tests/phpunit/Handlebars/FlowPostMetaActionsTest.php
+++ b/tests/phpunit/Handlebars/FlowPostMetaActionsTest.php
@@ -4,6 +4,7 @@
 
 use Flow\Container;
 use Flow\TemplateHelper;
+use LightnCandy;
 use Symfony\Component\DomCrawler\Crawler;
 
 /**
@@ -107,11 +108,13 @@
        }
 
        protected function renderTemplate( $templateName, array $args = array() 
) {
-               $lc = new TemplateHelper(
-                       Container::get( 'lightncandy.template_dir' ),
-                       true // force recompile
+               $lc = Container::get( 'lightncandy' );
+               $filenames = $lc->getTemplateFilenames( $templateName );
+               $phpCode = $lc::compile(
+                       file_get_contents( $filenames['template'] ),
+                       Container::get( 'lightncandy.template_dir' )
                );
-               $renderer = $lc->getTemplate( $templateName );
+               $renderer = LightnCandy::prepare( $phpCode );
 
                return new Crawler( $renderer( $args ) );
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/171592
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7dadd551a5340c8a9ad615a23d4e7bd8bfe2bf65
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to