Skip to content

Commit d5cd4b3

Browse files
authored
Add test for stack prepend (#36555)
1 parent 7126531 commit d5cd4b3

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/View/ViewFactoryTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,27 @@ public function testMultipleStackPush()
443443
$this->assertSame('hi, Hello!', $factory->yieldPushContent('foo'));
444444
}
445445

446+
public function testSingleStackPrepend()
447+
{
448+
$factory = $this->getFactory();
449+
$factory->startPrepend('foo');
450+
echo 'hi';
451+
$factory->stopPrepend();
452+
$this->assertSame('hi', $factory->yieldPushContent('foo'));
453+
}
454+
455+
public function testMultipleStackPrepend()
456+
{
457+
$factory = $this->getFactory();
458+
$factory->startPrepend('foo');
459+
echo ', Hello!';
460+
$factory->stopPrepend();
461+
$factory->startPrepend('foo');
462+
echo 'hi';
463+
$factory->stopPrepend();
464+
$this->assertSame('hi, Hello!', $factory->yieldPushContent('foo'));
465+
}
466+
446467
public function testSessionAppending()
447468
{
448469
$factory = $this->getFactory();

0 commit comments

Comments
 (0)