Skip to content

Commit

Permalink
Merge pull request #70 from ben-xo/testing-failures-69
Browse files Browse the repository at this point in the history
Added a test to warn that the test suite is invalid against a non-empty default ini
  • Loading branch information
ben-xo authored May 23, 2023
2 parents 178c977 + bf796a2 commit 01c65a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest, macos-11]
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2']
runs-on: ${{ matrix.operating-system }}
steps:
- name: Setup PHP and extensions
Expand Down
8 changes: 8 additions & 0 deletions test/DefaultsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 01c65a3

Please sign in to comment.