emogrifier icon indicating copy to clipboard operation
emogrifier copied to clipboard

Replace `joinDatasets()` in `AbstractHtmlProcessorTest` with a method from `rawr/phpunit-data-provider`

Open oliverklee opened this issue 4 months ago • 2 comments

oliverklee avatar Nov 02 '25 10:11 oliverklee

DataProvider::cross() "creates a matrix of given data providers". The joinDatasets method returns only the first row and the first column of that matrix. It is useful in situations where it is not necessary to test all combinations, but just ensure each of the input sets is included in at least one output combination, so as to avoid a large number of unnecessary tests. There is currently no equivalent in rawr/phpunit-data-provider.

JakeQZ avatar Nov 02 '25 16:11 JakeQZ

There is currently no equivalent in rawr/phpunit-data-provider.

DataProvider::zip() is the closest. If this was able to accept providers with differing numbers of rows, perhaps repeating the last row of the shorter ones (or cycling through), it would do the job. Alternatively, we could use DataProvider::join() to concatenate the shorter set with itself until it is long enough, then DataProvider.drop() to trim it to the exact length.

JakeQZ avatar Nov 02 '25 16:11 JakeQZ