A provider that builds its cases from something created in setUp() fails with a null, because every provider in the class runs before any test does — including before the class is instantiated.
public function vatRates(): array
{
// $this->taxTable does not exist yet
return [
'germany' => ['DE', 10000, 11900],
'turkey' => ['TR', 10000, 11800],
];
}
Providers must be self-contained, which is a constraint worth accepting rather than working around — a case that needs a fixture is describing the fixture as data, and building it inside the test from the provider’s values is clearer anyway. Naming the cases with string keys makes a failure report with data set "germany" instead of data set #0, which is the difference between reading and counting.