Skip to content

Commit 9534e90

Browse files
committed
Adding additional tests for overrides
1 parent c358ce7 commit 9534e90

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/Liquid/ContextTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,24 @@ public function testArrayFirst()
325325
$this->assertEquals(11, $this->context->get('array.first'));
326326
}
327327

328+
public function testOverrideFirst()
329+
{
330+
$this->context->set('array', array(11, 'jack', 43, 'first' => 74, 5, 'tom'));
331+
$this->assertEquals(74, $this->context->get('array.first'));
332+
}
333+
328334
public function testArrayLast()
329335
{
330336
$this->context->set('array', array(11, 'jack', 43, 74, 5, 'tom'));
331337
$this->assertEquals('tom', $this->context->get('array.last'));
332338
}
333339

340+
public function testOverrideLast()
341+
{
342+
$this->context->set('array', array(11, 'jack', 43, 'last' => 74, 5, 'tom'));
343+
$this->assertEquals(74, $this->context->get('array.last'));
344+
}
345+
334346
public function testDeepValueNotObject()
335347
{
336348
$this->context->set('example', array('foo' => new ToLiquidNotObject()));

0 commit comments

Comments
 (0)