Skip to content

Commit a1df17d

Browse files
authored
Merge branch 'main' into feature/modules
2 parents ba509f3 + 5862efd commit a1df17d

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

GIT_CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog
22
## [unreleased]
33

4+
### Features
5+
6+
- Modules (#262)
7+
48
### Miscellaneous Tasks
59

610
- Update devdependencies (major) (#256)

tests/Commands/AddChangelogTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function test_handle_command_successfull()
3535
->assertOk();
3636
}
3737

38+
3839
#[Test]
3940
public function test_handle_command_with_question_check()
4041
{
@@ -82,7 +83,6 @@ public function test_handle_command_with_module_and_existing_type()
8283
$expected
8384
);
8485
}
85-
8686
#[Test]
8787
public function test_handle_command_with_module_and_without_module()
8888
{

tests/Commands/GenerateChangelogMdCommandTest.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,44 @@ public function test_handle_command_with_generate_correct_file_with_ordered_vers
101101
$this->compare_template_ordered($result);
102102
}
103103

104+
public function test_handle_command_with_modules()
105+
{
106+
// Changelog mit globalen und Modul-Items
107+
$changelog = [
108+
'unreleased' => [
109+
'name' => 'tbd',
110+
'date' => '',
111+
'release' => false,
112+
'added' => [
113+
['message' => 'Globale Änderung 1'],
114+
['message' => 'Globale Änderung 2'],
115+
],
116+
'modules' => [
117+
'User' => [
118+
'fixed' => [
119+
['message' => 'Fehler im User-Modul behoben'],
120+
['message' => 'Validierung verbessert'],
121+
],
122+
'added' => [
123+
['message' => 'Neues Feld im User-Modul'],
124+
],
125+
],
126+
'Payment' => [
127+
'changed' => [
128+
['message' => 'Zahlungslogik angepasst'],
129+
],
130+
],
131+
],
132+
],
133+
];
134+
file_put_contents(FileHandler::pathChangelog(), json_encode($changelog));
135+
$this->artisan('changelog:generate-md')->assertOk();
136+
$result = file_get_contents(FileHandler::pathChangelogMd());
137+
$result = str_replace("\r", '', $result);
138+
$expected = file_get_contents(__DIR__ . '/changelog-md.blade.modules.expected');
139+
$this->assertEquals(trim($expected), trim($result));
140+
}
141+
104142
/**
105143
* @param string $result
106144
* @return null

0 commit comments

Comments
 (0)