Skip to content

Commit 4c5c1f9

Browse files
MAGETWO-58132: [GitHub] module:uninstall can remove code it uses itself #5797
1 parent 8bf902a commit 4c5c1f9

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

dev/tests/integration/testsuite/Magento/Framework/Composer/RemoveTest.php

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,32 @@
55
*/
66
namespace Magento\Framework\Composer;
77

8-
use Magento\Framework\App\Filesystem\DirectoryList;
8+
use Magento\Composer\MagentoComposerApplication;
99

1010
class RemoveTest extends \PHPUnit_Framework_TestCase
1111
{
1212
public function testRemove()
1313
{
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();
2120

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+
]
2929

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);
3334

3435
$remove = new Remove($composerAppFactory);
3536
$remove->remove(['magento/package-a', 'magento/package-b']);

lib/internal/Magento/Framework/Composer/Remove.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public function remove(array $packages)
4545
return $composerApplication->runComposerCommand(
4646
[
4747
'command' => 'remove',
48-
'packages' => $packages
48+
'packages' => $packages,
49+
'--no-update' => true,
4950
]
5051
);
5152
}

0 commit comments

Comments
 (0)