7 use Composer\Console\Application;
10 use Symfony\Component\Console\Output\BufferedOutput;
36 $this->composerApplication = $this->createMock(\Composer\Console\Application::class);
37 $this->inputFactory = $this->createMock(\
Magento\Composer\ConsoleArrayInputFactory::class);
38 $this->consoleOutput = $this->createMock(\Symfony\Component\Console\Output\BufferedOutput::class);
43 $this->composerApplication,
55 $this->composerApplication->expects($this->once())->method(
'run')->willReturn(1);
57 $this->application->runComposerCommand([
'command'=>
'update']);
62 $inputData = [
'command' =>
'update', MagentoComposerApplication::COMPOSER_WORKING_DIR =>
'.'];
64 $this->composerApplication->expects($this->once())->method(
'resetComposer');
66 $this->inputFactory->expects($this->once())->method(
'create')->with($inputData);
68 $this->consoleOutput->expects($this->once())->method(
'fetch')->willReturn(
'Nothing to update');
70 $this->composerApplication->expects($this->once())->method(
'run')->willReturn(0);
72 $message = $this->application->runComposerCommand($inputData);
73 $this->assertEquals(
'Nothing to update',
$message);