Restore Tcpdf/Dompdf to Samples in Test Suite (#2814)

They were dropped because they weren't ready for PHP8 when we were. They are ready now.
This commit is contained in:
oleibman 2022-05-08 11:48:04 -07:00 committed by GitHub
parent 35530502d2
commit eb34e02085
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 17 deletions

View File

@ -11,10 +11,8 @@ class SampleTest extends TestCase
* @runInSeparateProcess * @runInSeparateProcess
* @preserveGlobalState disabled * @preserveGlobalState disabled
* @dataProvider providerSample * @dataProvider providerSample
*
* @param mixed $sample
*/ */
public function testSample($sample): void public function testSample(string $sample): void
{ {
// Suppress output to console // Suppress output to console
$this->setOutputCallback(function (): void { $this->setOutputCallback(function (): void {
@ -32,18 +30,8 @@ class SampleTest extends TestCase
'Chart/32_Chart_read_write_HTML.php', // idem 'Chart/32_Chart_read_write_HTML.php', // idem
'Chart/35_Chart_render.php', // idem 'Chart/35_Chart_render.php', // idem
]; ];
// TCPDF and DomPDF libraries don't support PHP8 yet
if (\PHP_VERSION_ID >= 80000) {
$skipped = array_merge(
$skipped,
[
'Pdf/21_Pdf_Domdf.php',
'Pdf/21_Pdf_TCPDF.php',
]
);
}
// Unfortunately some tests are too long be ran with code-coverage // Unfortunately some tests are too long to run with code-coverage
// analysis on GitHub Actions, so we need to exclude them // analysis on GitHub Actions, so we need to exclude them
global $argv; global $argv;
if (in_array('--coverage-clover', $argv)) { if (in_array('--coverage-clover', $argv)) {
@ -58,9 +46,6 @@ class SampleTest extends TestCase
$result = []; $result = [];
foreach ($helper->getSamples() as $samples) { foreach ($helper->getSamples() as $samples) {
foreach ($samples as $sample) { foreach ($samples as $sample) {
// if (array_pop(explode('/', $sample)) !== 'DGET.php') {
// continue;
// }
if (!in_array($sample, $skipped)) { if (!in_array($sample, $skipped)) {
$file = 'samples/' . $sample; $file = 'samples/' . $sample;
$result[$sample] = [$file]; $result[$sample] = [$file];