Skip to content

Commit

Permalink
Add test to verify key omission rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Riimu committed Jan 21, 2015
1 parent 6d8cfcd commit 1199c03
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/tests/ArrayEncodingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,29 @@ public function testInlineArray()
$this->assertEncode("[7, 8, 8, 9]", [7, 8, 8, 9], $encoder);
}

public function testOmittedKeySkips()
{
$this->assertEncode(
$this->format(
<<<'RESULT'
[
1 => 1,
2,
10 => 10,
3 => 3,
4 => 4,
11,
12,
13,
15 => 15,
]
RESULT
),
[1 => 1, 2 => 2, 10 => 10, 3 => 3, 4 => 4, 11 => 11, 12 => 12, 13 => 13, 15 => 15],
new PHPEncoder()
);
}

public function testInlineWithMultiLineString()
{
$this->assertEncode(
Expand Down

0 comments on commit 1199c03

Please sign in to comment.