File tree 2 files changed +21
-19
lines changed
dev/tests/integration/testsuite/Magento/Framework/Composer
lib/internal/Magento/Framework/Composer
2 files changed +21
-19
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Framework \Composer ;
7
7
8
- use Magento \Framework \ App \ Filesystem \ DirectoryList ;
8
+ use Magento \Composer \ MagentoComposerApplication ;
9
9
10
10
class RemoveTest extends \PHPUnit_Framework_TestCase
11
11
{
12
12
public function testRemove ()
13
13
{
14
- $ composerAppFactory = $ this ->getMock (
15
- \Magento \Framework \Composer \MagentoComposerApplicationFactory::class,
16
- [],
17
- [],
18
- '' ,
19
- false
20
- );
14
+ $ composerAppFactory = $ this ->getMockBuilder (MagentoComposerApplicationFactory::class)
15
+ ->disableOriginalConstructor ()
16
+ ->getMock ();
17
+ $ composerApp = $ this ->getMockBuilder (MagentoComposerApplication::class)
18
+ ->disableOriginalConstructor ()
19
+ ->getMock ();
21
20
22
- $ composerApp = $ this ->getMock (
23
- \Magento \Composer \MagentoComposerApplication::class,
24
- [],
25
- [],
26
- '' ,
27
- false
28
- );
21
+ $ composerApp ->expects ($ this ->once ())
22
+ ->method ('runComposerCommand ' )
23
+ ->with (
24
+ [
25
+ 'command ' => 'remove ' ,
26
+ 'packages ' => ['magento/package-a ' , 'magento/package-b ' ],
27
+ '--no-update ' => true ,
28
+ ]
29
29
30
- $ composerApp ->expects ($ this ->once ())->method ('runComposerCommand ' );
31
-
32
- $ composerAppFactory ->expects ($ this ->once ())->method ('create ' )->willReturn ($ composerApp );
30
+ );
31
+ $ composerAppFactory ->expects ($ this ->once ())
32
+ ->method ('create ' )
33
+ ->willReturn ($ composerApp );
33
34
34
35
$ remove = new Remove ($ composerAppFactory );
35
36
$ remove ->remove (['magento/package-a ' , 'magento/package-b ' ]);
Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ public function remove(array $packages)
45
45
return $ composerApplication ->runComposerCommand (
46
46
[
47
47
'command ' => 'remove ' ,
48
- 'packages ' => $ packages
48
+ 'packages ' => $ packages ,
49
+ '--no-update ' => true ,
49
50
]
50
51
);
51
52
}
You can’t perform that action at this time.
0 commit comments