public function testZipToSpecificTarget() { $this->zipFile = Zip::dir($this->source, $this->target); $command = sprintf('unzip %s -d %s', $this->zipFile, $this->testingFolder); exec($command); $originalFolderStructure = Tree::from($this->source); $extractedFolderStructure = Tree::from($this->testingFolder . basename($this->source)); $this->assertEquals($originalFolderStructure, $extractedFolderStructure); }
public function getAllEnums() { if (false === self::$installerRan) { Install::run(); self::$installerRan = true; } $timeZoneEnumDir = '/../src/TimeZone'; $enumFiles = Tree::from(__DIR__ . $timeZoneEnumDir)['TimeZone']; $enums = array_map(function ($item) { $name = str_replace('.php', '', $item); return ['WebIt4Me\\TimeZone\\' . $name, $name]; }, $enumFiles); return $enums; }
/** * Return Array of all existing timezones * * @return AbstractTimeZoneEnum[] */ public function getAllTimeZone() { if (is_null($this->timeZoneEnums)) { foreach (Tree::from(__DIR__ . '/TimeZone')['TimeZone'] as $file) { $fullName = sprintf('WebIt4Me\\TimeZone\\%s', str_replace('.php', '', $file)); $this->timeZoneEnums[str_replace('WebIt4Me\\TimeZone\\', '', $fullName)] = new $fullName(); } } return $this->timeZoneEnums; }