This repository has been archived by the owner on Dec 3, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
67 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
packages/ChangelogLinker/tests/ChangelogDumper/ChangelogDumperMultipleItemsTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Symplify\ChangelogLinker\Tests\ChangelogDumper; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Symplify\ChangelogLinker\ChangelogDumper; | ||
use Symplify\ChangelogLinker\ChangelogFormatter; | ||
use Symplify\ChangelogLinker\ChangeTree\Change; | ||
use Symplify\ChangelogLinker\Git\GitCommitDateTagResolver; | ||
|
||
final class ChangelogDumperMultipleItemsTest extends TestCase | ||
{ | ||
/** | ||
* @var Change[] | ||
*/ | ||
private $changes = []; | ||
|
||
/** | ||
* @var ChangelogDumper | ||
*/ | ||
private $changelogDumper; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->changelogDumper = new ChangelogDumper(new GitCommitDateTagResolver(), new ChangelogFormatter()); | ||
|
||
$this->changes = [ | ||
new Change('[SomePackage] Message', 'Added', 'SomePackage', 'Message', 'Unreleased'), | ||
new Change('[AnotherPackage] Message', 'Fixed', 'AnotherPackage', 'Another Message', 'Unreleased'), | ||
]; | ||
} | ||
|
||
public function testReportBothWithPriority(): void | ||
{ | ||
$content = $this->changelogDumper->reportChangesWithHeadlines($this->changes, true, true, 'packages'); | ||
|
||
$this->assertStringEqualsFile(__DIR__ . '/ChangelogDumperSource/expected-multiple1.md', $content); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...angelogLinker/tests/ChangelogDumper/ChangelogDumperSource/expected-multiple1.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
## Unreleased | ||
|
||
### SomePackage | ||
|
||
#### Added | ||
|
||
Message | ||
|
||
### AnotherPackage | ||
|
||
#### Fixed | ||
|
||
Another Message | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters