xp-framework / unittest

Unittests for the XP Framework
0 stars 0 forks source link

Map values #25

Closed thekid closed 7 years ago

thekid commented 7 years ago

This pull request adds a way to support a map containing the arguments to be passed to a value function.

Example

class LiteralsTest extends ParseTest {

  #[@test, @values(map= [
  #  '0' => 0,
  #  '1' => 1
  #])]
  public function integer($input, $expect) {
    $this->assertNodes([['(literal)' => $expect]], $this->parse($input.';'));
  }
}

See also the original unittest parameterization RFC, xp-framework/rfc#267

thekid commented 7 years ago

Released in 9.3.0.