Пример #1
0
 /**
  * @param Module $oldModule
  * @param Module $newModule
  * @return ConfirmationQuestion
  * @internal param Module $module
  */
 private function buildQuestion(Module $oldModule, Module $newModule)
 {
     return new ConfirmationQuestion(sprintf('<question>Do you want to override the module "%s" with "%s"?</question>[y]', trim($oldModule->getPackage() . ' ' . $oldModule->getVersion()), trim($newModule->getPackage() . ' ' . $newModule->getVersion())));
 }
Пример #2
0
 /**
  * @param Module $newModule
  * @param $hasModule
  * @return \PHPUnit_Framework_MockObject_MockObject
  */
 private function provideModuleManager(Module $newModule, $hasModule)
 {
     $oldModule = clone $newModule;
     $oldModule->setDescription($newModule->getDescription() . '_old');
     $oldModule->setPackage($newModule->getPackage() . '_old');
     $oldModule->setVersion($newModule->getVersion() . '_old');
     $moduleManager = $this->getMockBuilder('Balloon\\Balloon')->disableOriginalConstructor()->getMock();
     $moduleManager->expects($this->once())->method('has')->with($newModule->getName())->will($this->returnValue($hasModule));
     $moduleManager->expects($this->any())->method('get')->with($newModule->getName())->will($this->returnValue($oldModule));
     return $moduleManager;
 }
Пример #3
0
 /**
  * @param Module $module
  * @return string
  */
 private function buildConfigPath(Module $module)
 {
     return $this->composer->getHomePath() . '/vendor/' . $module->getPackage() . '/.samurai.json';
 }