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:
Michael Kaufmann
2019-06-06 10:18:03 +02:00
parent 0afbe3d13b
commit d8a8f76dc9
11 changed files with 439 additions and 502 deletions

View File

@@ -4,8 +4,8 @@ php:
# - "5.4" # - "5.4"
# - "5.6" # - "5.6"
# - "7.0" # - "7.0"
- "7.1" # - "7.1"
# - "7.2" - "7.3"
branches: branches:
only: only:
@@ -18,7 +18,7 @@ matrix:
# env: deps=highest # env: deps=highest
# - php: 5.4 # - php: 5.4
# env: deps=lowest # env: deps=lowest
- php: 7.1 - php: 7.3
env: deps=highest env: deps=highest
mysql: mysql:

View File

@@ -226,7 +226,20 @@
<property name="phpcpd.done" value="true" /> <property name="phpcpd.done" value="true" />
</target> </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"> description="Run unit tests with PHPUnit">
<exec executable="${phpunit}" resultproperty="result.phpunit" <exec executable="${phpunit}" resultproperty="result.phpunit"
taskname="phpunit"> taskname="phpunit">
@@ -234,6 +247,8 @@
<arg path="${basedir}/phpunit.xml" /> <arg path="${basedir}/phpunit.xml" />
<arg value="--testsuite" /> <arg value="--testsuite" />
<arg value="froxlor" /> <arg value="froxlor" />
<arg value="--prepend" />
<arg path="${basedir}/tests/xdebug-filter.php" />
</exec> </exec>
<property name="phpunit.done" value="true" /> <property name="phpunit.done" value="true" />

View File

@@ -49,17 +49,16 @@
"algo26-matthias/idna-convert": "^2.1" "algo26-matthias/idna-convert": "^2.1"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "6.5.13", "phpunit/phpunit": "^8",
"pdepend/pdepend": "2.5.0", "php": ">=7.3",
"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",
"ext-pcntl": "*", "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": { "suggest": {
"ext-bcmath": "*", "ext-bcmath": "*",

871
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -340,11 +340,12 @@ class Customers extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resource
'login' => $loginname 'login' => $loginname
), true, true); ), 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)) { if (strtolower($loginname_check['loginname']) == strtolower($loginname) || strtolower($loginname_check_admin['loginname']) == strtolower($loginname)) {
\Froxlor\UI\Response::standard_error('loginnameexists', $loginname, true); \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')))) { } elseif (! \Froxlor\Validate\Validate::validateUsername($loginname, Settings::Get('panel.unix_names'), $mysql_maxlen)) {
if (strlen($loginname) > 14 - strlen(Settings::Get('customer.mysqlprefix'))) { if (strlen($loginname) > $mysql_maxlen) {
\Froxlor\UI\Response::standard_error('loginnameiswrong2', 14 - strlen(Settings::Get('customer.mysqlprefix')), true); \Froxlor\UI\Response::standard_error('loginnameiswrong2', $mysql_maxlen, true);
} else { } else {
\Froxlor\UI\Response::standard_error('loginnameiswrong', $loginname, true); \Froxlor\UI\Response::standard_error('loginnameiswrong', $loginname, true);
} }

View File

@@ -193,7 +193,7 @@ class Database
// MySQL user names can be up to 32 characters long (16 characters before MySQL 5.7.8). // MySQL user names can be up to 32 characters long (16 characters before MySQL 5.7.8).
$mysql_max = 32; $mysql_max = 32;
if (version_compare(Database::getAttribute(\PDO::ATTR_SERVER_VERSION), '5.7.8', '<')) { if (version_compare(Database::getAttribute(\PDO::ATTR_SERVER_VERSION), '5.7.8', '<')) {
$mysql_max -= 16; $mysql_max = 16;
} }
return $mysql_max; return $mysql_max;
} }

View File

@@ -192,7 +192,7 @@ class Check
} }
$returnvalue = array(); $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( $returnvalue = array(
self::FORMFIELDS_PLAUSIBILITY_CHECK_OK self::FORMFIELDS_PLAUSIBILITY_CHECK_OK
); );

View File

@@ -2,7 +2,7 @@
<phpunit backupGlobals="false" backupStaticAttributes="false" <phpunit backupGlobals="false" backupStaticAttributes="false"
colors="false" convertErrorsToExceptions="true" colors="false" convertErrorsToExceptions="true"
convertNoticesToExceptions="true" convertWarningsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true"
processIsolation="false" stopOnFailure="false" syntaxCheck="false" processIsolation="false" stopOnFailure="false"
bootstrap="tests/bootstrap.php"> bootstrap="tests/bootstrap.php">
<testsuites> <testsuites>
@@ -29,13 +29,11 @@
</testsuites> </testsuites>
<logging> <logging>
<log type="coverage-html" target="build/coverage" title="froxlor" <log type="coverage-html" target="build/coverage"
charset="UTF-8" yui="true" highlight="true" lowUpperBound="35" lowUpperBound="35" highLowerBound="70" />
highLowerBound="70" />
<log type="coverage-clover" target="build/logs/clover.xml" /> <log type="coverage-clover" target="build/logs/clover.xml" />
<log type="coverage-crap4j" target="build/logs/crap4j.xml" /> <log type="coverage-crap4j" target="build/logs/crap4j.xml" />
<log type="junit" target="build/logs/junit.xml" <log type="junit" target="build/logs/junit.xml" />
logIncompleteSkipped="false" />
</logging> </logging>
<filter> <filter>

View File

@@ -545,7 +545,7 @@ class CustomersTest extends TestCase
'customernumber' => 1339 '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(); Customers::getLocal($admin_userdata, $data)->add();
} }
} }

View File

@@ -8,7 +8,8 @@ use PHPUnit\Framework\TestCase;
class SettingsTest extends TestCase class SettingsTest extends TestCase
{ {
protected function setUp() { protected function setUp(): void
{
// start fresh // start fresh
\Froxlor\Settings::Stash(); \Froxlor\Settings::Stash();
} }

View File

@@ -16,7 +16,7 @@ use Froxlor\Api\Commands\Traffic;
class TrafficTest extends TestCase class TrafficTest extends TestCase
{ {
public static function setUpBeforeClass() public static function setUpBeforeClass(): void
{ {
$ins_stmt = Database::prepare(" $ins_stmt = Database::prepare("
INSERT INTO `" . TABLE_PANEL_TRAFFIC . "` SET INSERT INTO `" . TABLE_PANEL_TRAFFIC . "` SET