Ejemplo n.º 1
0
 public function __construct(IniParams $iniParams, Logger $systemLogger)
 {
     $this->iniParams = $iniParams;
     $this->systemLogger = $systemLogger;
     $locale = $this->iniParams->get("locale");
     I18n::setLocale($locale);
 }
Ejemplo n.º 2
0
 protected function setUp()
 {
     $this->db = TestsHelpers::getDb();
     //$this->db->setVerboseMode();
     $this->logger = LoggerFactory::getFileLogger(TestsHelpers::getUserLog(), Logger::INFO);
     $this->iniParams = TestsHelpers::getIniParams();
     $this->okChannel = new OkChannel($this->iniParams->get("channelId"), $this->db);
     $this->xmlImporter = new Orders($this->okChannel, $this->iniParams, $this->db, $this->logger);
     $bfOrderDataProvider = new BfOrderDataProvider(__DIR__ . '/Data/orders.xml');
     $this->bfOrdersArray = $bfOrderDataProvider->getOrders();
     $locale = $this->iniParams->get("locale");
     I18n::setLocale($locale);
     self::deleteTestsOrders($this->iniParams, $this->db);
 }
Ejemplo n.º 3
0
{
    echo "\n{$locale} : ";
    echo _("PHPUnit test string");
}
function testDecimal()
{
    $decimal = new Decimal(LoggerFactory::getNullLogger());
    $decimal->set(5.6);
    if (!$decimal->isValid()) {
        echo "\nInvalid decimal separator !";
    } else {
        echo "\nValid decimal separator";
    }
    echo "\n";
}
bindtextdomain("default", E7_PATH . "/tests/i18n");
textdomain("default");
// No locale
testTranslation("Default");
testDecimal();
// de_DE
$locale = "de_DE";
I18n::setLocale($locale);
testTranslation($locale);
testDecimal();
// fr_FR
$locale = "fr_FR";
I18n::setLocale($locale);
testTranslation($locale);
testDecimal();
echo "\n";