/** * @test */ public function addPackageAddsResourcesFromCalculatedBundle() { $bundle = new Bundle(); $bundle->addFile('path/to/package/file.php'); $this->mockPharComposer->expects($this->once())->method('getPathLocalToBase')->with($this->equalTo('path/to/package/file.php'))->will($this->returnValue('file.php')); $this->mockBox->expects($this->once())->method('addFile')->with($this->equalTo('path/to/package/file.php'), $this->equalTo('file.php')); $mockFinder = $this->createMock('Symfony\\Component\\Finder\\Finder'); $bundle->addDir($mockFinder); $this->mockPharComposer->expects($this->once())->method('getBase')->will($this->returnValue('path/to/package')); $this->mockBox->expects($this->once())->method('buildFromIterator')->with($this->equalTo($mockFinder), $this->equalTo('path/to/package')); $this->targetPhar->addBundle($bundle); }
private function addFile(Bundle $bundle, $file) { $this->logger->log(' adding "' . $file . '"'); $bundle->addFile($this->package->getAbsolutePath($file)); }