From b129d5718b915e276ff5d0c497d9104e196c644d Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 20 Mar 2024 03:00:23 +0000 Subject: [PATCH] fix tests --- Config/rectortmp.php | 53 +++++++++++++++++++++++++ Helper/Php/findMissingNullModelTest.php | 6 +-- Helper/Scripts/inspectproject.sh | 2 +- Helper/Scripts/serverInstall.sh | 3 +- Inspection/Php/stats.sh | 2 +- 5 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 Config/rectortmp.php diff --git a/Config/rectortmp.php b/Config/rectortmp.php new file mode 100644 index 0000000..0bd31ca --- /dev/null +++ b/Config/rectortmp.php @@ -0,0 +1,53 @@ +sets([ + PHPUnitSetList::PHPUNIT_100, + PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES, + ]); + + $rectorConfig->paths([ + __DIR__ . '/../../tests', + __DIR__ . '/../../Modules/**/tests', + __DIR__ . '/../../phpOMS/tests', + ]); + + $rectorConfig->skip([ + __DIR__ . '/../../vendor', + '*/vendor', + '*/node_modules', + __DIR__ . '/../../privateSetup', + __DIR__ . '/../../demoSetup', + __DIR__ . '/../../Build', + __DIR__ . '/../../MainRepository', + __DIR__ . '/../../Resources', + __DIR__ . '/../../Tools', + __DIR__ . '/../../Sandbox', + __DIR__ . '/../../cssOMS', + '*/Admin/Install/Application', + ]); +}; \ No newline at end of file diff --git a/Helper/Php/findMissingNullModelTest.php b/Helper/Php/findMissingNullModelTest.php index 831f8f8..9d0aaa6 100644 --- a/Helper/Php/findMissingNullModelTest.php +++ b/Helper/Php/findMissingNullModelTest.php @@ -79,7 +79,7 @@ foreach ($modules as $module) { . 'final class Null' . $model . 'Test extends \PHPUnit\Framework\TestCase' . "\n" . '{' . "\n" . ' /**' . "\n" - . ' * @covers Modules\\' . $module . '\Models\Null' . $model . '' . "\n" + . ' * @covers \Modules\\' . $module . '\Models\Null' . $model . '' . "\n" . ' * @group module' . "\n" . ' */' . "\n" . ' public function testNull() : void' . "\n" @@ -88,7 +88,7 @@ foreach ($modules as $module) { . ' }' . "\n" . "\n" . ' /**' . "\n" - . ' * @covers Modules\\' . $module . '\Models\Null' . $model . '' . "\n" + . ' * @covers \Modules\\' . $module . '\Models\Null' . $model . '' . "\n" . ' * @group module' . "\n" . ' */' . "\n" . ' public function testId() : void' . "\n" @@ -98,7 +98,7 @@ foreach ($modules as $module) { . ' }' . "\n" . "\n" . ' /**' . "\n" - . ' * @covers Modules\\' . $module . '\Models\Null' . $model . '' . "\n" + . ' * @covers \Modules\\' . $module . '\Models\Null' . $model . '' . "\n" . ' * @group module' . "\n" . ' */' . "\n" . ' public function testJsonSerialize() : void' . "\n" diff --git a/Helper/Scripts/inspectproject.sh b/Helper/Scripts/inspectproject.sh index 8b261be..5336dae 100644 --- a/Helper/Scripts/inspectproject.sh +++ b/Helper/Scripts/inspectproject.sh @@ -51,4 +51,4 @@ echo "#################################################" echo "# PHP stats inspection" echo "#################################################" -./vendor/bin/phploc --exclude vendor --exclude node_modules --exclude Resources --exclude Build --exclude .git --exclude privateSetup --exclude demoSetup ./ +#./vendor/bin/phploc --exclude vendor --exclude node_modules --exclude Resources --exclude Build --exclude .git --exclude privateSetup --exclude demoSetup ./ diff --git a/Helper/Scripts/serverInstall.sh b/Helper/Scripts/serverInstall.sh index 32427f3..00ee096 100644 --- a/Helper/Scripts/serverInstall.sh +++ b/Helper/Scripts/serverInstall.sh @@ -8,6 +8,7 @@ export PROMPT_COMMAND='echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" >> /var/www/html/backup/bash/$(date "+%d").log' +add-apt-repository ppa:ondrej/php apt-get update apt-get upgrade apt-get install git snapd ufw software-properties-common composer nodejs npm @@ -37,7 +38,7 @@ service fail2ban restart ## Web ############################################################### -apt-get install php8.1 php8.1-dev php8.1-cli php8.1-common php8.1-mysql php8.1-pgsql php8.1-xdebug php8.1-opcache php8.1-pdo php8.1-sqlite php8.1-mbstring php8.1-curl php8.1-imap php8.1-bcmath php8.1-zip php8.1-dom php8.1-xml php8.1-phar php8.1-gd php-pear apache2 libapache2-mpm-itk apache2-utils mariadb-server mariadb-client wkhtmltopdf tesseract-ocr poppler-utils imagemagick +apt-get install php8.2 php8.2-dev php8.2-cli php8.2-common php8.2-intl php8.2-mysql php8.2-pgsql php8.2-xdebug php8.2-opcache php8.2-pdo php8.2-sqlite php8.2-mbstring php8.2-curl php8.2-imap php8.2-bcmath php8.2-zip php8.2-dom php8.2-xml php8.2-phar php8.2-gd php-pear apache2 libapache2-mpm-itk apache2-utils mariadb-server mariadb-client wkhtmltopdf tesseract-ocr poppler-utils imagemagick pecl install pcov #echo "extension=pcov.so" > /etc/php/cli/conf.d/20-xdebug.ini diff --git a/Inspection/Php/stats.sh b/Inspection/Php/stats.sh index e5b2622..e2d041a 100755 --- a/Inspection/Php/stats.sh +++ b/Inspection/Php/stats.sh @@ -7,5 +7,5 @@ echo "Start php stats inspection" echo "#################################################" # -php ${TOOLS_PATH}/vendor/bin/phploc ${INSPECTION_PATH} > ${OUTPUT_PATH}/phploc.log || true +#php ${TOOLS_PATH}/vendor/bin/phploc ${INSPECTION_PATH} > ${OUTPUT_PATH}/phploc.log || true php ${TOOLS_PATH}/vendor/bin/phpmetrics --config=${BUILD_PATH}/Config/phpmetrics.json --junit=${OUTPUT_PATH}/junit_php.xml --report-html=${OUTPUT_PATH}/metrics ${INSPECTION_PATH} || true \ No newline at end of file