-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue with dot notation in only/except functions
- Loading branch information
Nathan Macnamara
committed
Jul 17, 2014
1 parent
2ba95f5
commit 32afd76
Showing
2 changed files
with
91 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,10 +27,15 @@ public function return_value_for_multi_level_key() | |
->method('_payload') | ||
->will($this->returnValue('{"id": 123, "note": {"headers": {"to": "[email protected]", "from": "[email protected]"}, "body": "Hello World"}}')); | ||
|
||
|
||
$this->assertEquals('123', $parser->get('id')); | ||
$this->assertEquals('Hello World', $parser->get('note.body')); | ||
$this->assertEquals('[email protected]', $parser->get('note.headers.to')); | ||
$this->assertTrue($parser->has('note.headers.to')); | ||
|
||
$this->assertEquals(array('id' => 123, 'note' => array('headers' => array('from' => '[email protected]'), 'body' => 'Hello World')), $parser->except('note.headers.to')); | ||
$this->assertEquals(array('id' => 123, 'note' => array('headers' => array('to' => '[email protected]', 'from' => '[email protected]'))), $parser->except('note.body')); | ||
|
||
$this->assertEquals(array('id' => 123, 'status' => null, 'note' => array('body' => 'Hello World')), $parser->only('note.body', 'id', 'status')); | ||
} | ||
|
||
/** @test */ | ||
|