Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 81d9fdc

Browse files
committed
Added test for intl php extension as it is used to localize month names (see IntlDateFormatter in AJXP_Utils::relativeDate)
1 parent b341660 commit 81d9fdc

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

core/src/core/tests/test.PHP_INTL.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
/*
3+
* Copyright 2007-2016 Charles du Jeu - Abstrium SAS <team (at) pyd.io>
4+
* This file is part of Pydio.
5+
*
6+
* Pydio is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU Affero General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* Pydio is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU Affero General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Affero General Public License
17+
* along with Pydio. If not, see <http://www.gnu.org/licenses/>.
18+
*
19+
* The latest code can be found at <http://pyd.io/>.
20+
*/
21+
defined('AJXP_EXEC') or die( 'Access not allowed');
22+
require_once('../classes/class.AbstractTest.php');
23+
24+
/**
25+
* Check that intl is enabled
26+
* @package AjaXplorer
27+
* @subpackage Tests
28+
*/
29+
class PHP_INTL extends AbstractTest
30+
{
31+
public function __construct() { parent::__construct("PHP INTL extension", "Pydio used intl to localize month names."); }
32+
public function doTest()
33+
{
34+
$this->failedLevel = "warning";
35+
36+
if (extension_loaded('intl')) {
37+
$this->failedInfo = "PHP INTL extension detected. Month names can be localized depending on the users language.";
38+
$this->testedParams["PHP INTL extension loaded"] = "Yes";
39+
return TRUE;
40+
} else {
41+
$this->failedInfo = "PHP INTL extension missing. English month names will be used for all languages.";
42+
$this->testedParams["PHP INTL extension loaded"] = "No";
43+
return FALSE;
44+
}
45+
}
46+
}

0 commit comments

Comments
 (0)