| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 19 | public function getProvidedData(ExampleNode $example, string $dataProviderMethod): array |
||
| 20 | { |
||
| 21 | $specification = $example->getSpecification()->getClassReflection(); |
||
| 22 | if (!$specification->hasMethod($dataProviderMethod)) { |
||
| 23 | return []; |
||
| 24 | } |
||
| 25 | |||
| 26 | $subject = $specification->newInstance(); |
||
| 27 | $providedData = $specification->getMethod($dataProviderMethod)->invoke($subject); |
||
| 28 | |||
| 29 | return is_array($providedData) |
||
| 30 | ? $providedData |
||
| 31 | : []; |
||
| 32 | } |
||
| 33 | } |