/** * Return the bundle path * @param string $bundleName * @return string */ private static function getBundlePath($bundleName) { $bundlePath = "application/i18n/" . self::$bundleLocale . '/' . $bundleName . ".xml"; // If the locale is "fr_FR", we check if the dir "fr_FR" exists, else we use only the language ("fr") if (FileUtils::existsInIncludePath($bundlePath) === false) { $bundlePath = "application/i18n/" . self::getDefaultLanguage() . '/' . $bundleName . ".xml"; } // if it still doesn't exists, we use the default locale which we're pretty sure it exists. if (FileUtils::existsInIncludePath($bundlePath) === false) { $bundlePath = "application/i18n/" . self::DEFAULT_LOCALE . '/' . $bundleName . ".xml"; } return $bundlePath; }
/** * @covers FileUtils::existsInIncludePath */ public function testExistsInIncludePathNotInc() { $actual = \FileUtils::existsInIncludePath(__DIR__ . '/' . basename(__FILE__)); $this->assertTrue($actual); }