예제 #1
0
 /**
  * @test
  * @dataProvider validPackageKeys
  */
 public function constructAcceptsValidPackageKeys($packageKey)
 {
     $packagePath = 'vfs://Packages/' . str_replace('\\', '/', $packageKey) . '/';
     mkdir($packagePath, 0777, TRUE);
     file_put_contents($packagePath . 'composer.json', '{"name": "' . $packageKey . '", "type": "flow-test"}');
     file_put_contents($packagePath . 'ext_emconf.php', '');
     $packageManagerMock = $this->getMock(\TYPO3\CMS\Core\Package\PackageManager::class);
     $packageManagerMock->expects($this->any())->method('isPackageKeyValid')->willReturn(TRUE);
     $package = new Package($packageManagerMock, $packageKey, $packagePath);
     $this->assertEquals($packageKey, $package->getPackageKey());
 }
예제 #2
0
 /**
  * @param Package $package
  * @return array
  */
 public function getChecksumsForExtension(Package $package)
 {
     $_EXTKEY = $package->getPackageKey();
     $configurationFile = $package->getPackagePath() . 'ext_emconf.php';
     $EM_CONF = null;
     if (file_exists($configurationFile)) {
         include $configurationFile;
         if (!empty($EM_CONF[$_EXTKEY]['_md5_values_when_last_written'])) {
             return unserialize($EM_CONF[$_EXTKEY]['_md5_values_when_last_written']);
         }
     }
     return array();
 }
 /**
  * @param Package|null $package
  * @return array
  */
 public function findDifferentExtensionInformation(Package $package)
 {
     $storedExtensionInformation = $this->extensionInformation[$package->getPackageKey()];
     $currentExtensionInformation = $this->fetchExtensionInformation($package);
     return $this->diffComparator->getDifferences($storedExtensionInformation['checksums'], $currentExtensionInformation['checksums']);
 }