Skip to content

Commit

Permalink
Drop Phug < 1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekatarnls committed Feb 3, 2020
1 parent be4d799 commit 81e10e2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"php": ">=5.5.0",
"js-phpize/js-phpize-phug": "^1.1 || ^2.0",
"nodejs-php-fallback/nodejs-php-fallback": "^1.3.1",
"phug/phug": "^0.3.0 || ^1.0",
"phug/phug": "^1.6",
"phug/js-transformer-filter": "^1.0"
},
"extra": {
Expand Down
16 changes: 16 additions & 0 deletions tests/features/share.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function testResetSharedVariables()
$pug->resetSharedVariables();

$error = null;

try {
$pug->render("p\n ?=\$foo\n=' '\n=\$bar\n | !");
} catch (\Exception $e) {
Expand All @@ -51,4 +52,19 @@ public function testResetSharedVariables()

self::assertRegExp('/Undefined variable: foo/', $error);
}

public function testShareThis()
{
$pug = new Pug([
'debug' => true,
'exit_on_error' => false,
]);
$pug->share([
'this' => (object) [
'foo' => 'bar',
],
]);

self::assertSame('<p>bar</p>', $pug->render('p=this.foo'));
}
}

0 comments on commit 81e10e2

Please sign in to comment.