-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Allow to mark JSON properties & XML nodes as optional (#102) * Add optional expander definition * Add hasExpander method for Pattern * Allow mark JSON properties & xml nodes as optional * Use intuitive matcher type definition in Xml test stock qty node definition * Add information about optional Expander to README * Remove return type declaration * Catch PHPMatcher Exception when parsing pattern for optional values * Add getName to PatternExpander interface * Remove unncessary ExpanderInitializer dependency in TypePattern * Use constants for expander name instead of method * Redeclare $expanderDefinitions using constants * Add static is($name) method to PatternExpander interface * revert php 7.0 feature * drop php 5.3, 5.4 support * Use proper test case base class * Use proper test case base class * Fixed has expander method
- Loading branch information
1 parent
5be920e
commit 79a27d1
Showing
26 changed files
with
503 additions
and
33 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 |
---|---|---|
|
@@ -83,6 +83,7 @@ $matcher->getError(); // returns null or error message | |
* ``inArray($value)`` | ||
* ``oneOf(...$expanders)`` - example usage ``"@[email protected](contains('foo'), contains('bar'), contains('baz'))"`` | ||
* ``matchRegex($regex)`` - example usage ``"@[email protected]('/^lorem.+/')"`` | ||
* ``optional()`` - work's only with ``ArrayMatcher``, ``JsonMatcher`` and ``XmlMatcher`` | ||
|
||
##Example usage | ||
|
||
|
@@ -237,7 +238,8 @@ $matcher->match( | |
'id' => 1, | ||
'firstName' => 'Norbert', | ||
'lastName' => 'Orzechowicz', | ||
'roles' => array('ROLE_USER') | ||
'roles' => array('ROLE_USER'), | ||
'position' => 'Developer', | ||
), | ||
array( | ||
'id' => 2, | ||
|
@@ -261,7 +263,8 @@ $matcher->match( | |
'id' => '@[email protected](0)', | ||
'firstName' => '@string@', | ||
'lastName' => 'Orzechowicz', | ||
'roles' => '@array@' | ||
'roles' => '@array@', | ||
'position' => '@[email protected]()' | ||
), | ||
array( | ||
'id' => '@integer@', | ||
|
@@ -303,7 +306,8 @@ $matcher->match( | |
"firstName": @string@, | ||
"lastName": @string@, | ||
"created": "@[email protected]()", | ||
"roles": @array@ | ||
"roles": @array@, | ||
"posiiton": "@[email protected]()" | ||
} | ||
] | ||
}' | ||
|
@@ -347,6 +351,7 @@ XML | |
<m:GetStockPrice> | ||
<m:StockName>@string@</m:StockName> | ||
<m:StockValue>@string@</m:StockValue> | ||
<m:StockQty>@[email protected]()</m:StockQty> | ||
</m:GetStockPrice> | ||
</soap:Body> | ||
|
||
|
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
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
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
Oops, something went wrong.