-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from baopham/v1-remove-nested-attributes
Support remove nested attributes
- Loading branch information
Showing
5 changed files
with
108 additions
and
40 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
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
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace BaoPham\DynamoDb\Tests\Parsers; | ||
|
||
use BaoPham\DynamoDb\Parsers\ExpressionAttributeNames; | ||
use BaoPham\DynamoDb\Parsers\UpdateExpression; | ||
use BaoPham\DynamoDb\Tests\TestCase; | ||
|
||
class UpdateExpressionTest extends TestCase | ||
{ | ||
/** | ||
* @var UpdateExpression | ||
*/ | ||
private $parser; | ||
|
||
/** | ||
* @var ExpressionAttributeNames | ||
*/ | ||
private $names; | ||
|
||
public function setUp() | ||
{ | ||
parent::setUp(); | ||
$this->names = new ExpressionAttributeNames(); | ||
$this->parser = new UpdateExpression($this->names); | ||
} | ||
|
||
public function testParse() | ||
{ | ||
$expression = $this->parser->remove(['foo.bar', 'a', 'b', 'hello[0]']); | ||
$this->assertEquals('REMOVE #a, #b, foo.bar, hello[0]', $expression); | ||
$this->assertEquals([ | ||
'#a' => 'a', | ||
'#b' => 'b' | ||
], $this->names->all()); | ||
} | ||
} |