update dev-environment to use more recent versions, requries php-7.3 now (dev-only)
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -4,8 +4,8 @@ php:
|
||||
# - "5.4"
|
||||
# - "5.6"
|
||||
# - "7.0"
|
||||
- "7.1"
|
||||
# - "7.2"
|
||||
# - "7.1"
|
||||
- "7.3"
|
||||
|
||||
branches:
|
||||
only:
|
||||
@@ -18,7 +18,7 @@ matrix:
|
||||
# env: deps=highest
|
||||
# - php: 5.4
|
||||
# env: deps=lowest
|
||||
- php: 7.1
|
||||
- php: 7.3
|
||||
env: deps=highest
|
||||
|
||||
mysql:
|
||||
|
||||
17
build.xml
17
build.xml
@@ -226,7 +226,20 @@
|
||||
<property name="phpcpd.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="phpunit" unless="phpunit.done" depends="composer"
|
||||
<target name="phpunit-prepare" unless="phpunit-prepare.done" depends="composer"
|
||||
description="prepare xdebug unit tests">
|
||||
<exec executable="${phpunit}" resultproperty="result.phpunit-prepare"
|
||||
taskname="phpunit">
|
||||
<arg value="--configuration" />
|
||||
<arg path="${basedir}/phpunit.xml" />
|
||||
<arg value="--dump-xdebug-filter" />
|
||||
<arg path="${basedir}/tests/xdebug-filter.php" />
|
||||
</exec>
|
||||
|
||||
<property name="phpunit-prepare.done" value="true" />
|
||||
</target>
|
||||
|
||||
<target name="phpunit" unless="phpunit.done" depends="phpunit-prepare"
|
||||
description="Run unit tests with PHPUnit">
|
||||
<exec executable="${phpunit}" resultproperty="result.phpunit"
|
||||
taskname="phpunit">
|
||||
@@ -234,6 +247,8 @@
|
||||
<arg path="${basedir}/phpunit.xml" />
|
||||
<arg value="--testsuite" />
|
||||
<arg value="froxlor" />
|
||||
<arg value="--prepend" />
|
||||
<arg path="${basedir}/tests/xdebug-filter.php" />
|
||||
</exec>
|
||||
|
||||
<property name="phpunit.done" value="true" />
|
||||
|
||||
@@ -49,17 +49,16 @@
|
||||
"algo26-matthias/idna-convert": "^2.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "6.5.13",
|
||||
"pdepend/pdepend": "2.5.0",
|
||||
"phpmd/phpmd": "2.6.0",
|
||||
"sebastian/phpcpd": "3.0.1",
|
||||
"squizlabs/php_codesniffer": "3.3.2",
|
||||
"phploc/phploc": "3.0.1",
|
||||
"theseer/phpdox": "0.11.2",
|
||||
"phpunit/php-invoker": "1.1.4",
|
||||
"php": ">=7.1",
|
||||
"phpunit/phpunit": "^8",
|
||||
"php": ">=7.3",
|
||||
"ext-pcntl": "*",
|
||||
"phpcompatibility/php-compatibility": "*"
|
||||
"phpcompatibility/php-compatibility": "*",
|
||||
"squizlabs/php_codesniffer": "*",
|
||||
"pdepend/pdepend": "^2.5",
|
||||
"sebastian/phpcpd": "^4.1",
|
||||
"theseer/phpdox": "^0.12.0",
|
||||
"phploc/phploc": "^5.0",
|
||||
"phpmd/phpmd": "^2.6"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-bcmath": "*",
|
||||
|
||||
871
composer.lock
generated
871
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -340,11 +340,12 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
|
||||
'login' => $loginname
|
||||
), true, true);
|
||||
|
||||
$mysql_maxlen = \Froxlor\Database\Database::getSqlUsernameLength() - strlen(Settings::Get('customer.mysqlprefix'));
|
||||
if (strtolower($loginname_check['loginname']) == strtolower($loginname) || strtolower($loginname_check_admin['loginname']) == strtolower($loginname)) {
|
||||
\Froxlor\UI\Response::standard_error('loginnameexists', $loginname, true);
|
||||
} elseif (! \Froxlor\Validate\Validate::validateUsername($loginname, Settings::Get('panel.unix_names'), 14 - strlen(Settings::Get('customer.mysqlprefix')))) {
|
||||
if (strlen($loginname) > 14 - strlen(Settings::Get('customer.mysqlprefix'))) {
|
||||
\Froxlor\UI\Response::standard_error('loginnameiswrong2', 14 - strlen(Settings::Get('customer.mysqlprefix')), true);
|
||||
} elseif (! \Froxlor\Validate\Validate::validateUsername($loginname, Settings::Get('panel.unix_names'), $mysql_maxlen)) {
|
||||
if (strlen($loginname) > $mysql_maxlen) {
|
||||
\Froxlor\UI\Response::standard_error('loginnameiswrong2', $mysql_maxlen, true);
|
||||
} else {
|
||||
\Froxlor\UI\Response::standard_error('loginnameiswrong', $loginname, true);
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ class Database
|
||||
// MySQL user names can be up to 32 characters long (16 characters before MySQL 5.7.8).
|
||||
$mysql_max = 32;
|
||||
if (version_compare(Database::getAttribute(\PDO::ATTR_SERVER_VERSION), '5.7.8', '<')) {
|
||||
$mysql_max -= 16;
|
||||
$mysql_max = 16;
|
||||
}
|
||||
return $mysql_max;
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ class Check
|
||||
}
|
||||
|
||||
$returnvalue = array();
|
||||
if (Validate::validateUsername($newfieldvalue, Settings::Get('panel.unix_names'), 14 - strlen($allnewfieldvalues['customer_mysqlprefix'])) === true) {
|
||||
if (Validate::validateUsername($newfieldvalue, Settings::Get('panel.unix_names'), \Froxlor\Database\Database::getSqlUsernameLength() - strlen($allnewfieldvalues['customer_mysqlprefix'])) === true) {
|
||||
$returnvalue = array(
|
||||
self::FORMFIELDS_PLAUSIBILITY_CHECK_OK
|
||||
);
|
||||
|
||||
10
phpunit.xml
10
phpunit.xml
@@ -2,7 +2,7 @@
|
||||
<phpunit backupGlobals="false" backupStaticAttributes="false"
|
||||
colors="false" convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true" convertWarningsToExceptions="true"
|
||||
processIsolation="false" stopOnFailure="false" syntaxCheck="false"
|
||||
processIsolation="false" stopOnFailure="false"
|
||||
bootstrap="tests/bootstrap.php">
|
||||
|
||||
<testsuites>
|
||||
@@ -29,13 +29,11 @@
|
||||
</testsuites>
|
||||
|
||||
<logging>
|
||||
<log type="coverage-html" target="build/coverage" title="froxlor"
|
||||
charset="UTF-8" yui="true" highlight="true" lowUpperBound="35"
|
||||
highLowerBound="70" />
|
||||
<log type="coverage-html" target="build/coverage"
|
||||
lowUpperBound="35" highLowerBound="70" />
|
||||
<log type="coverage-clover" target="build/logs/clover.xml" />
|
||||
<log type="coverage-crap4j" target="build/logs/crap4j.xml" />
|
||||
<log type="junit" target="build/logs/junit.xml"
|
||||
logIncompleteSkipped="false" />
|
||||
<log type="junit" target="build/logs/junit.xml" />
|
||||
</logging>
|
||||
|
||||
<filter>
|
||||
|
||||
@@ -545,7 +545,7 @@ class CustomersTest extends TestCase
|
||||
'customernumber' => 1339
|
||||
];
|
||||
|
||||
$this->expectExceptionMessage('Loginname contains too many characters. Only ' . (14 - strlen(Settings::Get('customer.mysqlprefix'))) . ' characters are allowed.');
|
||||
$this->expectExceptionMessage('Loginname contains too many characters. Only ' . (\Froxlor\Database\Database::getSqlUsernameLength() - strlen(Settings::Get('customer.mysqlprefix'))) . ' characters are allowed.');
|
||||
Customers::getLocal($admin_userdata, $data)->add();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@ use PHPUnit\Framework\TestCase;
|
||||
class SettingsTest extends TestCase
|
||||
{
|
||||
|
||||
protected function setUp() {
|
||||
protected function setUp(): void
|
||||
{
|
||||
// start fresh
|
||||
\Froxlor\Settings::Stash();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ use Froxlor\Api\Commands\Traffic;
|
||||
class TrafficTest extends TestCase
|
||||
{
|
||||
|
||||
public static function setUpBeforeClass()
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
$ins_stmt = Database::prepare("
|
||||
INSERT INTO `" . TABLE_PANEL_TRAFFIC . "` SET
|
||||
|
||||
Reference in New Issue
Block a user