24
24
*/
25
25
final class ComposerJsonTest extends TestCase
26
26
{
27
- public function testFrameworkRequireIsTheSameWithDevRequire (): void
27
+ private array $ devComposer ;
28
+ private array $ frameworkComposer ;
29
+
30
+ protected function setUp (): void
28
31
{
29
- $ devComposer = $ this ->getComposerJson (dirname (__DIR__ , 2 ) . '/composer.json ' );
30
- $ frameworkComposer = $ this ->getComposerJson (dirname (__DIR__ , 2 ) . '/admin/framework/composer.json ' );
32
+ parent ::setUp ();
33
+
34
+ $ this ->devComposer = $ this ->getComposerJson (dirname (__DIR__ , 2 ) . '/composer.json ' );
35
+ $ this ->frameworkComposer = $ this ->getComposerJson (dirname (__DIR__ , 2 ) . '/admin/framework/composer.json ' );
36
+ }
31
37
38
+ public function testFrameworkRequireIsTheSameWithDevRequire (): void
39
+ {
32
40
$ this ->assertSame (
33
- $ devComposer ['require ' ],
34
- $ frameworkComposer ['require ' ],
41
+ $ this -> devComposer ['require ' ],
42
+ $ this -> frameworkComposer ['require ' ],
35
43
'The framework \'s "require" section is not updated with the main composer.json. '
36
44
);
37
45
}
38
46
39
47
public function testFrameworkRequireDevIsTheSameWithDevRequireDev (): void
40
48
{
41
- $ devComposer = $ this ->getComposerJson (dirname (__DIR__ , 2 ) . '/composer.json ' );
42
- $ frameworkComposer = $ this ->getComposerJson (dirname (__DIR__ , 2 ) . '/admin/framework/composer.json ' );
43
-
44
- $ devRequireDev = $ devComposer ['require-dev ' ];
45
- $ fwRequireDev = $ frameworkComposer ['require-dev ' ];
49
+ $ devRequireDev = $ this ->devComposer ['require-dev ' ];
50
+ $ fwRequireDev = $ this ->frameworkComposer ['require-dev ' ];
46
51
47
52
foreach ($ devRequireDev as $ dependency => $ expectedVersion ) {
48
53
if (! isset ($ fwRequireDev [$ dependency ])) {
@@ -62,6 +67,15 @@ public function testFrameworkRequireDevIsTheSameWithDevRequireDev(): void
62
67
}
63
68
}
64
69
70
+ public function testFrameworkSuggestIsTheSameWithDevSuggest (): void
71
+ {
72
+ $ this ->assertSame (
73
+ $ this ->devComposer ['suggest ' ],
74
+ $ this ->frameworkComposer ['suggest ' ],
75
+ 'The framework \'s "suggest" section is not updated with the main composer.json. '
76
+ );
77
+ }
78
+
65
79
private function getComposerJson (string $ path ): array
66
80
{
67
81
try {
0 commit comments