From 84ea3c227b50179ddde575e2cffaf7f75bbd615c Mon Sep 17 00:00:00 2001 From: Ben XO <75862+ben-xo@users.noreply.github.com> Date: Tue, 16 May 2023 01:21:31 +0100 Subject: [PATCH] Added a test to warn that the test suite is invalid against a non-empty default ini --- test/DefaultsTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/DefaultsTest.php b/test/DefaultsTest.php index 6e07642..590aea3 100644 --- a/test/DefaultsTest.php +++ b/test/DefaultsTest.php @@ -16,6 +16,14 @@ public static function setUpBeforeClass(): void exec('php dir2cast.php --output=out.xml', self::$output, self::$returncode); } + public function test_default_dir2cast_ini_is_functionally_empty(): void + { + $ini_content = file_get_contents('./dir2cast.ini'); + $this->assertGreaterThan(10000, strlen($ini_content), "ini file is unusually small. If you have edited it, some tests will fail."); + $ini_content = preg_replace("/^(;.*|\s*)\r\n/m", '', $ini_content); + $this->assertEquals("", $ini_content, "ini file is not the default. Some tests may fail."); + } + public function test_default_empty_podcast_creates_output(): void { $this->assertTrue(file_exists(self::$file));