From 81e10e2d890de01182aaeacc00ff4b25da807bab Mon Sep 17 00:00:00 2001 From: KyleKatarn Date: Tue, 4 Feb 2020 00:15:28 +0100 Subject: [PATCH] Drop Phug < 1.5 --- composer.json | 2 +- tests/features/share.php | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index fde87cfa..c32cea0b 100644 --- a/composer.json +++ b/composer.json @@ -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": { diff --git a/tests/features/share.php b/tests/features/share.php index fad93ded..d29698b2 100644 --- a/tests/features/share.php +++ b/tests/features/share.php @@ -43,6 +43,7 @@ public function testResetSharedVariables() $pug->resetSharedVariables(); $error = null; + try { $pug->render("p\n ?=\$foo\n=' '\n=\$bar\n | !"); } catch (\Exception $e) { @@ -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('

bar

', $pug->render('p=this.foo')); + } }