/** * @expectedException InvalidArgumentException * @expectedExceptionMessage Argument should be a valid path. */ public function testFindThemesInvalidPath() { Application_Form_Element_Theme::findThemes('/invalidPath'); }
/** * Set location of available themes. * * @param string $path */ public static function findThemes($path) { if (is_dir($path) === false) { throw new InvalidArgumentException("Argument should be a valid path."); } $themes = array(); foreach (glob($path . '/*') as $entry) { if (true === is_dir($entry)) { $theme = basename($entry); $themes[$theme] = $theme; } } self::$_themesPath = $path; self::$_themes = $themes; }