Skip to content

Commit 8281b11

Browse files
committed
test: refactor
1 parent 57d72d7 commit 8281b11

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

tests/system/AutoReview/ComposerJsonTest.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,7 @@ public function testFrameworkSuggestIsTheSameWithDevSuggest(): void
8181

8282
public function testStarterSuggestIsTheSameWithDevSuggest(): void
8383
{
84-
$this->assertSame(
85-
$this->devComposer['suggest'],
86-
$this->starterComposer['suggest'],
87-
'The starter\'s "suggest" section is not updated with the main composer.json.'
88-
);
84+
$this->checkStarter('suggest');
8985
}
9086

9187
public function testFrameworkConfigIsTheSameWithDevSuggest(): void
@@ -98,11 +94,16 @@ public function testFrameworkConfigIsTheSameWithDevSuggest(): void
9894
}
9995

10096
public function testStarterConfigIsTheSameWithDevSuggest(): void
97+
{
98+
$this->checkStarter('config');
99+
}
100+
101+
private function checkStarter(string $section): void
101102
{
102103
$this->assertSame(
103-
$this->devComposer['config'],
104-
$this->starterComposer['config'],
105-
'The starter\'s "config" section is not updated with the main composer.json.'
104+
$this->devComposer[$section],
105+
$this->starterComposer[$section],
106+
'The starter\'s "' . $section . '" section is not updated with the main composer.json.'
106107
);
107108
}
108109

0 commit comments

Comments
 (0)