From 395094ec1ca0c6cd0669d865665b2521eeac69d0 Mon Sep 17 00:00:00 2001 From: Bruce Wells Date: Wed, 21 Dec 2022 11:13:55 -0500 Subject: [PATCH] Create failures directory --- tests/Html2TextTest.php | 2 +- tests/failures/.gitignore | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tests/failures/.gitignore diff --git a/tests/Html2TextTest.php b/tests/Html2TextTest.php index 78b530b..9655aff 100644 --- a/tests/Html2TextTest.php +++ b/tests/Html2TextTest.php @@ -7,7 +7,7 @@ class Html2TextTest extends \PHPUnit\Framework\TestCase { // delete all failures before we run public static function setUpBeforeClass(): void { foreach (new DirectoryIterator(__DIR__ . '/failures') as $fileInfo) { - if(!$fileInfo->isDot()) { + if ($fileInfo->getFileName()[0] != '.') { unlink($fileInfo->getPathname()); } } diff --git a/tests/failures/.gitignore b/tests/failures/.gitignore new file mode 100644 index 0000000..ec91b1c --- /dev/null +++ b/tests/failures/.gitignore @@ -0,0 +1,8 @@ +# Ignore everything +* + +# But not these files... +!.gitignore + +# ...even if they are in subdirectories +!*/