File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,12 +73,20 @@ public function testFrameworkSuggestIsTheSameWithDevSuggest(): void
7373
7474 public function testFrameworkConfigIsTheSameWithDevSuggest (): void
7575 {
76- $ this ->checkFramework ('config ' );
76+ $ this ->checkConfig (
77+ $ this ->devComposer ['config ' ],
78+ $ this ->frameworkComposer ['config ' ],
79+ 'framework '
80+ );
7781 }
7882
7983 public function testStarterConfigIsTheSameWithDevSuggest (): void
8084 {
81- $ this ->checkStarter ('config ' );
85+ $ this ->checkConfig (
86+ $ this ->devComposer ['config ' ],
87+ $ this ->starterComposer ['config ' ],
88+ 'starter '
89+ );
8290 }
8391
8492 private function checkFramework (string $ section ): void
@@ -99,6 +107,25 @@ private function checkStarter(string $section): void
99107 );
100108 }
101109
110+ private function checkConfig (array $ fromMain , array $ fromComponent , string $ component ): void
111+ {
112+ foreach ($ fromMain as $ key => $ expectedValue ) {
113+ if (! isset ($ fromComponent [$ key ])) {
114+ $ this ->addToAssertionCount (1 );
115+
116+ continue ;
117+ }
118+
119+ $ actualValue = $ fromComponent [$ key ];
120+
121+ $ this ->assertSame ($ expectedValue , $ actualValue , sprintf (
122+ '%s \'s value for config property "%s" is not same with the main composer.json \'s config. ' ,
123+ ucfirst ($ component ),
124+ $ key
125+ ));
126+ }
127+ }
128+
102129 private function getComposerJson (string $ path ): array
103130 {
104131 try {
You can’t perform that action at this time.
0 commit comments