From d90054ee2247f22c05c698010f54e85e3eba390f Mon Sep 17 00:00:00 2001 From: Milwad <98118400+milwad-dev@users.noreply.github.com> Date: Mon, 22 May 2023 19:26:05 +0330 Subject: [PATCH] [10.x] Add test for `pushIf` directive (#47163) * add test for `pushIf` directive * add enter --- tests/View/Blade/BladePushTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/View/Blade/BladePushTest.php b/tests/View/Blade/BladePushTest.php index 9e9bfc95a2fb..103c5c13b692 100644 --- a/tests/View/Blade/BladePushTest.php +++ b/tests/View/Blade/BladePushTest.php @@ -53,6 +53,18 @@ public function testPushOnceIsCompiledWhenIdIsMissing() $expected = 'hasRenderedOnce(\'e60e8f77-9ac3-4f71-9f8e-a044ef481d7f\')): $__env->markAsRenderedOnce(\'e60e8f77-9ac3-4f71-9f8e-a044ef481d7f\'); $__env->startPush(\'foo\'); ?> test +stopPush(); endif; ?>'; + + $this->assertEquals($expected, $this->compiler->compileString($string)); + } + + public function testPushIfIsCompiled() + { + $string = '@pushIf(true, \'foo\') +test +@endPushIf'; + $expected = 'startPush( \'foo\'); ?> +test stopPush(); endif; ?>'; $this->assertEquals($expected, $this->compiler->compileString($string));