88use Codeception \Test \Interfaces \ScenarioDriven ;
99use Codeception \TestInterface ;
1010use Codeception \Util \PathResolver ;
11+ use PHPUnit \Framework \TestResult ;
12+ use SebastianBergmann \Template \Template ;
1113
1214class HTML extends CodeceptionResultPrinter
1315{
@@ -118,14 +120,14 @@ public function endTest(\PHPUnit\Framework\Test $test, float $time) : void
118120 }
119121 }
120122
121- $ scenarioTemplate = new \ Text_Template (
123+ $ scenarioTemplate = new Template (
122124 $ this ->templatePath . 'scenario.html '
123125 );
124126
125127 $ failures = '' ;
126128 $ name = Descriptor::getTestSignatureUnique ($ test );
127129 if (isset ($ this ->failures [$ name ])) {
128- $ failTemplate = new \ Text_Template (
130+ $ failTemplate = new Template (
129131 $ this ->templatePath . 'fail.html '
130132 );
131133 foreach ($ this ->failures [$ name ] as $ failure ) {
@@ -173,7 +175,7 @@ public function endTest(\PHPUnit\Framework\Test $test, float $time) : void
173175
174176 public function startTestSuite (\PHPUnit \Framework \TestSuite $ suite ) : void
175177 {
176- $ suiteTemplate = new \ Text_Template (
178+ $ suiteTemplate = new Template (
177179 $ this ->templatePath . 'suite.html '
178180 );
179181 if (!$ suite ->getName ()) {
@@ -190,7 +192,7 @@ public function startTestSuite(\PHPUnit\Framework\TestSuite $suite) : void
190192 */
191193 protected function endRun ():void
192194 {
193- $ scenarioHeaderTemplate = new \ Text_Template (
195+ $ scenarioHeaderTemplate = new Template (
194196 $ this ->templatePath . 'scenario_header.html '
195197 );
196198
@@ -209,7 +211,7 @@ protected function endRun():void
209211
210212 $ header = $ scenarioHeaderTemplate ->render ();
211213
212- $ scenariosTemplate = new \ Text_Template (
214+ $ scenariosTemplate = new Template (
213215 $ this ->templatePath . 'scenarios.html '
214216 );
215217
@@ -277,7 +279,7 @@ public function startTest(\PHPUnit\Framework\Test $test):void
277279 */
278280 protected function renderStep (Step $ step )
279281 {
280- $ stepTemplate = new \ Text_Template ($ this ->templatePath . 'step.html ' );
282+ $ stepTemplate = new Template ($ this ->templatePath . 'step.html ' );
281283 $ stepTemplate ->setVar (['action ' => $ step ->getHtml (), 'error ' => $ step ->hasFailed () ? 'failedStep ' : '' ]);
282284 return $ stepTemplate ->render ();
283285 }
@@ -289,7 +291,7 @@ protected function renderStep(Step $step)
289291 */
290292 protected function renderSubsteps (Meta $ metaStep , $ substepsBuffer )
291293 {
292- $ metaTemplate = new \ Text_Template ($ this ->templatePath . 'substeps.html ' );
294+ $ metaTemplate = new Template ($ this ->templatePath . 'substeps.html ' );
293295 $ metaTemplate ->setVar (['metaStep ' => $ metaStep ->getHtml (), 'error ' => $ metaStep ->hasFailed () ? 'failedStep ' : '' , 'steps ' => $ substepsBuffer , 'id ' => uniqid ()]);
294296 return $ metaTemplate ->render ();
295297 }
@@ -303,4 +305,8 @@ private function cleanMessage($exception)
303305 $ msg = str_replace (['<info> ' ,'</info> ' ,'<bold> ' ,'</bold> ' ], ['' ,'' ,'' ,'' ], $ msg );
304306 return htmlentities ($ msg );
305307 }
308+
309+ public function printResult (TestResult $ result ): void
310+ {
311+ }
306312}
0 commit comments