public function testGetPath() { $resources = new Resources(); foreach ($this->types as $type) { $path = $resources->getPath($type); $this->assertTrue(file_exists($path), 'Returns valid path.'); $this->assertTrue(is_dir($path), 'Returns directory.'); } }
public function __construct() { $className = get_class($this); $classNameParts = explode('\\', $className); $classNamePartCount = count($classNameParts); $this->name = $classNameParts[$classNamePartCount - 2]; $resources = new Resources(); $this->directory = $resources->getPath('plugins') . $this->name . '/'; $this->loadTemplateFiles(); }
protected function getPlugins($package) { $resources = new Resources(); $configPath = $resources->getPath('config'); $packages = json_decode(file_get_contents($configPath . 'packages.json'), true); if (!isset($packages[$package])) { throw new \RuntimeException('Not a supported type.'); } return $packages[$package]; }