@@ -20,11 +20,14 @@ class DependencyCheckerTest extends TestCase
20
20
*/
21
21
public function testCheckDependencies (): void
22
22
{
23
- $ composerApp =
24
- $ this ->createPartialMock (Application::class, ['setAutoExit ' , 'resetComposer ' , 'run ' ]);
23
+ $ composerApp = $ this ->getMockBuilder (Application::class)
24
+ ->setMethods (['setAutoExit ' , 'resetComposer ' , 'run ' ,'__destruct ' ])
25
+ ->disableOriginalConstructor ()
26
+ ->getMock ();
25
27
$ directoryList = $ this ->createMock (DirectoryList::class);
26
28
$ directoryList ->expects ($ this ->exactly (2 ))->method ('getRoot ' );
27
29
$ composerApp ->expects ($ this ->once ())->method ('setAutoExit ' )->with (false );
30
+ $ composerApp ->expects ($ this ->any ())->method ('__destruct ' );
28
31
29
32
$ composerApp
30
33
->method ('run ' )
@@ -35,6 +38,7 @@ function ($input, $buffer) {
35
38
'magento/project-community-edition requires magento/package-a (1.0) ' . PHP_EOL .
36
39
'magento/package-c requires magento/package-a (1.0) ' . PHP_EOL ;
37
40
$ buffer ->writeln ($ output );
41
+ return 1 ;
38
42
}
39
43
),
40
44
$ this ->returnCallback (
@@ -43,6 +47,7 @@ function ($input, $buffer) {
43
47
'magento/project-community-edition requires magento/package-a (1.0) ' . PHP_EOL .
44
48
'magento/package-d requires magento/package-b (1.0) ' . PHP_EOL ;
45
49
$ buffer ->writeln ($ output );
50
+ return 1 ;
46
51
}
47
52
)
48
53
);
@@ -64,11 +69,14 @@ function ($input, $buffer) {
64
69
*/
65
70
public function testCheckDependenciesExcludeSelf (): void
66
71
{
67
- $ composerApp =
68
- $ this ->createPartialMock (Application::class, ['setAutoExit ' , 'resetComposer ' , 'run ' ]);
72
+ $ composerApp = $ this ->getMockBuilder (Application::class)
73
+ ->setMethods (['setAutoExit ' , 'resetComposer ' , 'run ' ,'__destruct ' ])
74
+ ->disableOriginalConstructor ()
75
+ ->getMock ();
69
76
$ directoryList = $ this ->createMock (DirectoryList::class);
70
77
$ directoryList ->expects ($ this ->exactly (3 ))->method ('getRoot ' );
71
78
$ composerApp ->expects ($ this ->once ())->method ('setAutoExit ' )->with (false );
79
+ $ composerApp ->expects ($ this ->any ())->method ('__destruct ' );
72
80
73
81
$ composerApp
74
82
->method ('run ' )
@@ -79,6 +87,7 @@ function ($input, $buffer) {
79
87
'magento/project-community-edition requires magento/package-a (1.0) ' . PHP_EOL .
80
88
'magento/package-c requires magento/package-a (1.0) ' . PHP_EOL ;
81
89
$ buffer ->writeln ($ output );
90
+ return 1 ;
82
91
}
83
92
),
84
93
$ this ->returnCallback (
@@ -87,13 +96,15 @@ function ($input, $buffer) {
87
96
'magento/project-community-edition requires magento/package-a (1.0) ' . PHP_EOL .
88
97
'magento/package-d requires magento/package-b (1.0) ' . PHP_EOL ;
89
98
$ buffer ->writeln ($ output );
99
+ return 1 ;
90
100
}
91
101
),
92
102
$ this ->returnCallback (
93
103
function ($ input , $ buffer ) {
94
104
$ output = 'magento/package-d requires magento/package-c (1.0) ' . PHP_EOL .
95
105
'magento/project-community-edition requires magento/package-a (1.0) ' . PHP_EOL ;
96
106
$ buffer ->writeln ($ output );
107
+ return 1 ;
97
108
}
98
109
)
99
110
);
0 commit comments