1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
<?php
use Dompdf\Tests\OutputTest\Dataset;
use Dompdf\Tests\OutputTest\OutputTest;
/**
* Usage:
* * `php bin/update-reference-output.php` to update the reference files for all
* test cases
* * `php bin/update-reference-output.php <name-prefix>` to update the reference
* files for all test cases with a path starting with the specified prefix
* (paths considered relative to the parent `OutputTest` directory)
*/
require __DIR__ . "/../vendor/autoload.php";
$pathTest = $argv[1] ?? "";
$datasets = OutputTest::datasets();
$include = $pathTest !== ""
? function (Dataset $set) use ($pathTest) {
return substr($set->name, 0, strlen($pathTest)) === $pathTest;
} : function () {
return true;
};
foreach ($datasets as $dataset) {
if (!$include($dataset)) {
continue;
}
echo "Updating " . $dataset->name . PHP_EOL;
$dataset->updateReferenceFile();
}
|