Skip to content

Commit

Permalink
Merge pull request #17 from kpeeksf/kp/fixtests
Browse files Browse the repository at this point in the history
fix broken tests
  • Loading branch information
sam-osborne authored Jul 29, 2022
2 parents 5fcf4a0 + 0b09550 commit 12d2694
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/Handlebars/HandlebarsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public function testDataVariables1()
));
$template = "{{#each data}}{{@first}}, {{@last}}, {{@index}}, {{@unknown}}{{/each}}";

$this->assertEquals("", $engine->render($template, $data));
$this->assertEquals('apple, banana, 0, zucchini', $engine->render($template, $data));
}

/**
Expand Down Expand Up @@ -422,7 +422,11 @@ public function testCustomHelper()
*/
private function delTree($dir)
{
$files = array_diff(scandir($dir), array('.', '..'));
$contents = scandir($dir);
if ($contents === false) {
return;
}
$files = array_diff($contents, array('.', '..'));
foreach ($files as $file) {
(is_dir("$dir/$file")) ? delTree("$dir/$file") : unlink("$dir/$file");
}
Expand Down

0 comments on commit 12d2694

Please sign in to comment.