/** * * @param FileCollection $sharedFiles * @param Context $context */ protected function putDeferedSharedFiles($sharedFiles, Context $context) { $basepath = $this->transporter->getPath(); $sharedPath = $basepath . '/shared'; foreach ($sharedFiles as $file) { $src = FilePath::join($context->getBuilddir(), $file); $sharedFilepath = $sharedPath . '/' . $file; if (false === file_exists($src)) { // @todo we might wanna ask the user if he likes to continue or abort if ($this->io) { $this->io->write(sprintf('<error>Warning</error> <comment>%s</comment> not found', $src)); } continue; } $this->transporter->put($src, $sharedFilepath); } }
/** * @expectedException \InvalidArgumentException */ public function testPutThrowsExceptionWhenFileDoesnotExist() { $this->transporter->put($this->transporter->getPath() . '/non/existing/file', 'destination'); }