Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Zordius Chen committed Jan 27, 2016
1 parent b8f42b5 commit 49ee8bd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,9 @@ protected static function advancedVariable($vars, &$context, $token) {
* @expect array('foo', 'bar') when input 'foo bar', array('flags' => array('advar' => 1))
* @expect array('foo', "'bar'") when input "foo 'bar'", array('flags' => array('advar' => 1))
* @expect array('[fo o]', '"bar"') when input '[fo o] "bar"', array('flags' => array('advar' => 1))
* @expect array('fo=123', 'bar="456"') when input 'fo=123 bar="456"', array('flags' => array('advar' => 1))
* @expect array('fo=123', 'bar="45', '6"') when input 'fo=123 bar="45 6"', array('flags' => array('advar' => 0))
* @expect array('fo=123', 'bar="45 6"') when input 'fo=123 bar="45 6"', array('flags' => array('advar' => 1))
* @expect array('[fo', 'o]=123') when input '[fo o]=123', array('flags' => array('advar' => 0))
* @expect array('[fo o]=123') when input '[fo o]=123', array('flags' => array('advar' => 1))
* @expect array('[fo o]=123', 'bar="456"') when input '[fo o]=123 bar="456"', array('flags' => array('advar' => 1))
*/
Expand Down
10 changes: 8 additions & 2 deletions tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,14 @@ public function testOn_analyze() {
$this->assertEquals(array('[fo o]', '"bar"'), $method->invokeArgs(null, array_by_ref(array(
'[fo o] "bar"', array('flags' => array('advar' => 1))
))));
$this->assertEquals(array('fo=123', 'bar="456"'), $method->invokeArgs(null, array_by_ref(array(
'fo=123 bar="456"', array('flags' => array('advar' => 1))
$this->assertEquals(array('fo=123', 'bar="45', '6"'), $method->invokeArgs(null, array_by_ref(array(
'fo=123 bar="45 6"', array('flags' => array('advar' => 0))
))));
$this->assertEquals(array('fo=123', 'bar="45 6"'), $method->invokeArgs(null, array_by_ref(array(
'fo=123 bar="45 6"', array('flags' => array('advar' => 1))
))));
$this->assertEquals(array('[fo', 'o]=123'), $method->invokeArgs(null, array_by_ref(array(
'[fo o]=123', array('flags' => array('advar' => 0))
))));
$this->assertEquals(array('[fo o]=123'), $method->invokeArgs(null, array_by_ref(array(
'[fo o]=123', array('flags' => array('advar' => 1))
Expand Down

0 comments on commit 49ee8bd

Please sign in to comment.