diff --git a/tests/Unit/ChangelogTest.php b/tests/Unit/ChangelogTest.php index 378540e69..15e24855b 100644 --- a/tests/Unit/ChangelogTest.php +++ b/tests/Unit/ChangelogTest.php @@ -131,8 +131,12 @@ public function testChangelogFormat(string $changelogPath) } #[DataProvider('provideChangedServicesWithoutChangelog')] - public function testChangelogEntryForService(string $service, string $base, $isCommentOnly) + public function testChangelogEntryForService(string $service, string $base, bool $isCommentOnly) { + if ('' === $service) { + self::markTestSkipped('Nothing to test'); + } + if (!$isCommentOnly) { self::fail('Missing CHANGELOG entry for package ' . $service); } @@ -186,7 +190,7 @@ static function ($branch) { ); if (0 === \count($branches)) { - self::markTestSkipped('Cannot find the master branch'); + yield [null, null, null]; } usort($branches, static function ($a, $b) { @@ -242,6 +246,7 @@ static function ($branch) { $changedServices[$service]['files'][] = $subPath; } + $oneChange = false; foreach ($changedServices as $service => $changesService) { $changedFiles = $changesService['files']; if (\in_array('/CHANGELOG.md', $changedFiles, true)) { @@ -271,6 +276,10 @@ static function ($branch) { } yield [$service, $changesService['base'], $isCommentOnly]; + $oneChange = true; + } + if (!$oneChange) { + yield ['', '', false]; } }