Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete files created during tests #10

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions tests/integration/CompileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ public function testDataFiles(): void
$converter = new MarkdownConverter($environment);
$markdownFiles = \glob(\dirname(__DIR__) . '/data/*.md');
foreach ($markdownFiles as $markdownFile) {
if (\basename($markdownFile) === 'README.md') {
continue;
}

$workingDir = \dirname($markdownFile);
// Create a temp tex file in the tests directory, so it's got access to images etc.
$tmpTexFile = $workingDir . '/CompileTest_' . \pathinfo($markdownFile, PATHINFO_FILENAME) . '.tex';
$prefix = $workingDir . '/CompileTest_';
$tmpTexFile = $prefix . \pathinfo($markdownFile, PATHINFO_FILENAME) . '.tex';
$markdown = \file_get_contents($markdownFile);
$latex = "\\documentclass{article}\n"
. "\\usepackage{listings, graphicx, hyperref, footmisc}\n"
Expand All @@ -43,6 +40,8 @@ public function testDataFiles(): void
$process->mustRun();
$this->assertStringContainsString('Output written', $process->getOutput());
$this->assertStringContainsString('1 page', $process->getOutput());
// Delete temp files.
\array_map('unlink', \glob($prefix . '*'));
}
}
}
Loading