Compare commits

...

6 Commits

Author SHA1 Message Date
Clemens Schwaighofer 6b1261b157 Update dotenv to v3 2026-04-20 16:19:19 +09:00
Clemens Schwaighofer b695c3ffdc phive updates 2026-04-20 10:36:53 +09:00
Clemens Schwaighofer 90d76bbd6c phpunit coverate checks added with report to HTMl, phpstan check fixes for enum 2026-04-17 18:56:07 +09:00
Clemens Schwaighofer 188f0b57d0 Clean up .gitignore and add coverage option to phpunit.sh 2026-02-27 10:58:05 +09:00
Clemens Schwaighofer b84fb5cef5 Comemit message fix for function param (phpdoc) 2026-02-17 18:16:16 +09:00
Clemens Schwaighofer 9a28c86991 json test file update 2026-01-22 11:51:32 +09:00
12 changed files with 51 additions and 18 deletions
+3 -4
View File
@@ -1,10 +1,9 @@
.libs .libs
node_modules/ node_modules/
composer.lock **/composer.lock
vendor/ **/vendor/
tools/ tools/
www/composer.lock
www/vendor
**/.env **/.env
**/.target **/.target
package-lock.json package-lock.json
build/
+3 -3
View File
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive"> <phive xmlns="https://phar.io/phive">
<phar name="phpunit" version="~9.6" installed="9.6.31" location="./tools/phpunit" copy="false"/> <phar name="phpunit" version="~9.6" installed="9.6.34" location="./tools/phpunit" copy="false"/>
<phar name="phpcbf" version="4" installed="4.0.1" location="./tools/phpcbf" copy="false"/> <phar name="phpcbf" version="4" installed="4.0.1" location="./tools/phpcbf" copy="false"/>
<phar name="phpcs" version="4" installed="4.0.1" location="./tools/phpcs" copy="false"/> <phar name="phpcs" version="4" installed="4.0.1" location="./tools/phpcs" copy="false"/>
<phar name="phpstan" version="^2.0" installed="2.1.33" location="./tools/phpstan" copy="false"/> <phar name="phpstan" version="^2.0" installed="2.1.50" location="./tools/phpstan" copy="false"/>
<phar name="phan" version="^5.4.3" installed="5.5.2" location="./tools/phan" copy="false"/> <phar name="phan" version="^5.4.3" installed="5.5.2" location="./tools/phan" copy="false"/>
<phar name="psalm" version="^5.26.1" installed="5.26.1" location="./tools/psalm" copy="false"/> <phar name="psalm" version="^5.26.1" installed="5.26.1" location="./tools/psalm" copy="false"/>
<phar name="phpdox" version="^0.12.0" installed="0.12.0" location="./tools/phpdox" copy="false"/> <phar name="phpdox" version="^0.12.0" installed="0.12.0" location="./tools/phpdox" copy="false"/>
<phar name="phpdocumentor" version="^3.4.2" installed="3.9.1" location="./tools/phpDocumentor" copy="false"/> <phar name="phpdocumentor" version="^3.4.2" installed="3.9.1" location="./tools/phpDocumentor" copy="false"/>
<phar name="php-cs-fixer" version="^3.34.1" installed="3.92.4" location="./tools/php-cs-fixer" copy="false"/> <phar name="php-cs-fixer" version="^3.34.1" installed="3.95.1" location="./tools/php-cs-fixer" copy="false"/>
</phive> </phive>
+17
View File
@@ -19,6 +19,7 @@ Available options:
-v, --verbose Enable verbose output for PHPunit -v, --verbose Enable verbose output for PHPunit
-c, --composer Use composer version and not the default phives bundle -c, --composer Use composer version and not the default phives bundle
-p, --php VERSION Chose PHP version in the form of "N.N", if not found will exit -p, --php VERSION Chose PHP version in the form of "N.N", if not found will exit
-C, --coverage Generate code coverage report in text format (default: disabled)
EOF EOF
exit exit
} }
@@ -47,6 +48,8 @@ opt_verbose="";
php_version=""; php_version="";
no_php_version=0; no_php_version=0;
use_composer=0; use_composer=0;
opt_generate_coverage="";
opt_generate_coverage_html="";
while [ -n "${1-}" ]; do while [ -n "${1-}" ]; do
case "${1}" in case "${1}" in
-t | --testdox) -t | --testdox)
@@ -59,6 +62,14 @@ while [ -n "${1-}" ]; do
use_composer=1; use_composer=1;
shift shift
;; ;;
-C | --coverage)
opt_generate_coverage="--coverage-text";
shift
;;
--coverage-report)
opt_generate_coverage_html="--coverage-html build/coverage-report";
shift
;;
-p | --php) -p | --php)
php_version="${2-}"; php_version="${2-}";
shift shift
@@ -100,9 +111,15 @@ if [ "${use_composer}" -eq 1 ]; then
else else
PHPUNIT_CALL+=("${BASE_PATH}tools/phpunit"); PHPUNIT_CALL+=("${BASE_PATH}tools/phpunit");
fi; fi;
if [ -n "${opt_generate_coverage}" ]; then
echo "Will run coverage report";
export XDEBUG_MODE=coverage
fi;
PHPUNIT_CALL+=( PHPUNIT_CALL+=(
"${opt_testdox}" "${opt_testdox}"
"${opt_verbose}" "${opt_verbose}"
"${opt_generate_coverage}"
"${opt_generate_coverage_html}"
"-c" "${PHPUNIT_CONFIG}" "-c" "${PHPUNIT_CONFIG}"
"${BASE_PATH}4dev/tests/" "${BASE_PATH}4dev/tests/"
); );
-1
View File
@@ -45,7 +45,6 @@ use CoreLibs\DB\Support\ConvertPlaceholder;
* Test class for DB\IO + DB\SQL\PgSQL * Test class for DB\IO + DB\SQL\PgSQL
* This will only test the PgSQL parts * This will only test the PgSQL parts
* @coversDefaultClass \CoreLibs\DB\IO * @coversDefaultClass \CoreLibs\DB\IO
* @coversDefaultClass \CoreLibs\DB\SQL\PgSQL
* @testdox \CoreLibs\DB\IO method tests for SQL\PgSQL * @testdox \CoreLibs\DB\IO method tests for SQL\PgSQL
*/ */
final class CoreLibsDBIOTest extends TestCase final class CoreLibsDBIOTest extends TestCase
+1 -1
View File
@@ -1,7 +1,7 @@
<?php <?php
$set = 0; $set = 0;
foreach (['/../../www', '/../www', '/../..', '/..', '/../../src', '/../src'] as $src) { foreach (['/../../www', '/../www', '/../../src', '/../src', '/../..', '/..'] as $src) {
if (is_file(dirname(__DIR__) . $src . '/vendor/autoload.php')) { if (is_file(dirname(__DIR__) . $src . '/vendor/autoload.php')) {
require dirname(__DIR__) . $src . '/vendor/autoload.php'; require dirname(__DIR__) . $src . '/vendor/autoload.php';
$set = 1; $set = 1;
+5 -2
View File
@@ -1,8 +1,11 @@
// https://www.typescriptlang.org/tsconfig/#compilerOptions // https://www.typescriptlang.org/tsconfig/#compilerOptions
{ {
"compilerOptions": { "compilerOptions": {
"module": "ESNext", // if "bundler"
"moduleResolution": "Node", // "module": "ESNext",
"module": "NodeNext",
// "bundler" (front), "nodenext" or "node16"
"moduleResolution": "nodenext",
"target": "ES2020", "target": "ES2020",
"jsx": "react", "jsx": "react",
"checkJs": true, "checkJs": true,
+13
View File
@@ -10,4 +10,17 @@
<directory>4dev/tests</directory> <directory>4dev/tests</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./www/lib/CoreLibs</directory>
</include>
<!-- <report>
<html outputDirectory="build/coverage-report"/>
</report> -->
</coverage>
<!-- <source>
<include>
<directory>./www/lib/CoreLibs</directory>
</include>
</source> -->
</phpunit> </phpunit>
+3 -1
View File
@@ -59,8 +59,9 @@ $output = $json_class::jsonConvertToArray($json);
print "J/S::E-JSON: $json: " . DgS::printAr($output) . "<br>"; print "J/S::E-JSON: $json: " . DgS::printAr($output) . "<br>";
print "J/S::E-JSON ERROR: " . $json_class::jsonGetLastError() . ": " . $json_class::jsonGetLastError(true) . "<br>"; print "J/S::E-JSON ERROR: " . $json_class::jsonGetLastError() . ": " . $json_class::jsonGetLastError(true) . "<br>";
echo "<hr>";
$json = '{"valid":"json","invalid":"\xB1\x31"}'; $json = '{"valid":"json","invalid":"\xB1\x31"}';
$json = '{"valid":"json","invalid":"abc\x80def"}'; // $json = '{"valid":"json","invalid":"abc\x80def"}';
$output_no_flag = Json::jsonConvertToArray($json); $output_no_flag = Json::jsonConvertToArray($json);
print "No Flag JSON: $json: " . DgS::printAr($output_no_flag) . "<br>"; print "No Flag JSON: $json: " . DgS::printAr($output_no_flag) . "<br>";
print "No Flag JSON ERROR: " . Json::jsonGetLastError() . ": " . Json::jsonGetLastError(true) . "<br>"; print "No Flag JSON ERROR: " . Json::jsonGetLastError() . ": " . Json::jsonGetLastError(true) . "<br>";
@@ -73,6 +74,7 @@ $output_raw = json_decode($json, true, flags:JSON_INVALID_UTF8_SUBSTITUTE);
print "No Flag JSON RAW (F-2): $json: " . DgS::printAr($output_raw) . "<br>"; print "No Flag JSON RAW (F-2): $json: " . DgS::printAr($output_raw) . "<br>";
$output_raw = json_decode($json, true); $output_raw = json_decode($json, true);
print "No Flag JSON RAW: $json: " . DgS::printAr($output_raw) . "<br>"; print "No Flag JSON RAW: $json: " . DgS::printAr($output_raw) . "<br>";
echo "<hr>";
// $json = '{"foo": "bar"}'; // $json = '{"foo": "bar"}';
+2 -2
View File
@@ -17,13 +17,13 @@
"repositories": { "repositories": {
"git.egplusww.jp.Composer": { "git.egplusww.jp.Composer": {
"type": "composer", "type": "composer",
"url": "https://git.egplusww.jp/api/packages/Composer/composer" "url": "https://packages.omnicomproduction.jp/api/packages/Composer/composer"
} }
}, },
"require": { "require": {
"egrajp/smarty-extended": "^5.4", "egrajp/smarty-extended": "^5.4",
"php": ">=8.1", "php": ">=8.1",
"gullevek/dotenv": "^2.0", "gullevek/dotenv": "^3.0",
"psr/log": "^2.0 || ^3.0", "psr/log": "^2.0 || ^3.0",
"php-privacy/openpgp": "^2.1" "php-privacy/openpgp": "^2.1"
} }
+1 -1
View File
@@ -51,7 +51,7 @@ enum Convert: int
/** /**
* Get internal name from int value * Get internal name from int value
* *
* @param int $value * @param int $value
* @return self * @return self
*/ */
public static function fromValue(int $value): self public static function fromValue(int $value): self
+2 -2
View File
@@ -134,8 +134,8 @@ class Support
* Convert bool value to string value. Short name alias for printBool * Convert bool value to string value. Short name alias for printBool
* *
* @param bool $bool Bool value to be transformed * @param bool $bool Bool value to be transformed
* @param string $true [='true'] Override default string 'true' * @param string $true [=true] Override default string 'true'
* @param string $false [=false'] Override default string 'false' * @param string $false [=false] Override default string 'false'
* @return string $true or $false string for true/false bool * @return string $true or $false string for true/false bool
*/ */
public static function prBl( public static function prBl(
+1 -1
View File
@@ -63,7 +63,7 @@ enum Flag: int
/** /**
* Get internal name from int value * Get internal name from int value
* *
* @param int $value * @param value-of<self::VALUES> $value
* @return self * @return self
*/ */
public static function fromValue(int $value): self public static function fromValue(int $value): self