xp-framework/test

Only verify prerequisites once for parameterized tests

thekid opened this issue · 1 comments

Using the following test:

use test\verify\Runtime;
use test\{Assert, Test, Values};

class CalculatorTest {

  #[Test, Values([[1, 2], [0, 3]]), Runtime(php: '<8.0')]
  public function addition($a, $b) {
    Assert::equals(3, $a + $b);
  }
}

...the addition() method is invoked twice, and its prerequisites (which are independent of the provider values!) are checked more often than necessary:

image

This issue suggests changing the behavior to only check prerequisites once for parameterized tests.

What we want instead of the above:

image