From 81bf37947f9020fdc9fe77c01f34f48ef0ef971b Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Wed, 2 Jul 2025 23:40:27 +0200 Subject: [PATCH 01/10] Switching to Github Actions for CI --- .github/workflows/ci.yml | 203 +++++++++++++++++++++++ .gitignore | 16 +- .phan/config.php | 350 --------------------------------------- .phan/zip.phan_php | 145 ---------------- README.md | 2 +- composer.json | 4 +- phpstan.neon | 10 ++ 7 files changed, 228 insertions(+), 502 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .phan/config.php delete mode 100644 .phan/zip.phan_php create mode 100644 phpstan.neon diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..912e3fce7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,203 @@ +name: CI Joomla Framework + +on: + push: + pull_request: + schedule: + - cron: 15 2 * * 1 + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + composer: + name: Install PHP dependencies + runs-on: ubuntu-latest + container: joomlaprojects/docker-images:php8.1 + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + id: cache-php + with: + path: vendor + key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }} + - name: Install PHP dependencies + if: steps.cache-php.outputs.cache-hit != 'true' + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + composer config --global home + composer install --no-progress --ignore-platform-reqs + + code-style-php: + name: Check PHP code style + runs-on: ubuntu-latest + container: joomlaprojects/docker-images:php8.1 + needs: [composer] + steps: + - uses: actions/checkout@v4 + - uses: actions/cache/restore@v4 + with: + path: vendor + key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }} + - name: Check PHP code style + env: + PHP_CS_FIXER_IGNORE_ENV: true + run: ./vendor/bin/phpcs --standard=ruleset.xml src/ + + phpstan: + name: Run PHPstan + runs-on: ubuntu-latest + container: joomlaprojects/docker-images:php8.4 + needs: [code-style-php] + continue-on-error: true + steps: + - uses: actions/checkout@v4 + - uses: actions/cache/restore@v4 + with: + path: vendor + key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }} + - name: Run PHPstan + run: | + ./vendor/bin/phpstan --error-format=github + + tests-unit-sqlite: + name: Run Unit tests + runs-on: ubuntu-latest + container: joomlaprojects/docker-images:php${{ matrix.php_version }} + needs: [code-style-php] + strategy: + matrix: + php_version: ['8.1', '8.2', '8.3'] + steps: + - uses: actions/checkout@v4 + - name: Run Unit tests + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + composer update + ./vendor/bin/phpunit --configuration phpunit.sqlite.xml.dist + + tests-unit-mysql: + name: Run Unit tests + runs-on: ubuntu-latest + container: joomlaprojects/docker-images:php${{ matrix.php_version }} + needs: [code-style-php] + strategy: + matrix: + php_version: ['8.1', '8.2', '8.3'] + db_engine: ['mysql', 'mysqli'] + db_version: ['5.7', '8.0'] + steps: + - uses: actions/checkout@v4 + - name: Run Unit tests + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + composer update + ./vendor/bin/phpunit --configuration phpunit.${{ matrix.db_engine }}.xml.dist + services: + mysql: + image: mysql:${{ matrix.db_version }} + env: + MYSQL_USER: joomla_ut + MYSQL_PASSWORD: joomla_ut + MYSQL_ROOT_PASSWORD: joomla_ut + MYSQL_DATABASE: test_joomla + + tests-unit-mariadb: + name: Run Unit tests + runs-on: ubuntu-latest + container: joomlaprojects/docker-images:php${{ matrix.php_version }} + needs: [code-style-php] + strategy: + matrix: + php_version: ['8.1', '8.2', '8.3'] + steps: + - uses: actions/checkout@v4 + - name: Run Unit tests + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + composer update + ./vendor/bin/phpunit --configuration phpunit.mariadb.xml.dist + services: + mysql: + image: mariadb:10.2 + env: + MARIADB_USER: joomla_ut + MARIADB_PASSWORD: joomla_ut + MARIADB_ROOT_PASSWORD: joomla_ut + MARIADB_DATABASE: test_joomla + + tests-unit-postgres: + name: Run Unit tests + runs-on: ubuntu-latest + container: joomlaprojects/docker-images:php${{ matrix.php_version }} + needs: [code-style-php] + strategy: + matrix: + php_version: ['8.1', '8.2', '8.3'] + db_version: ['10', '11'] + steps: + - uses: actions/checkout@v4 + - name: Run Unit tests + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + composer update + ./vendor/bin/phpunit --configuration phpunit.pgsql.xml.dist + services: + postgres: + image: postgres:{{ matrix.db_version }}-alpine + env: + POSTGRES_USER: root + POSTGRES_PASSWORD: joomla_ut + POSTGRES_DB: test_joomla + + tests-unit-sqlsrv: + name: Run Unit tests + runs-on: ubuntu-latest + container: joomlaprojects/docker-images:php${{ matrix.php_version }} + needs: [code-style-php] + strategy: + matrix: + php_version: ['8.1', '8.2', '8.3'] + steps: + - uses: actions/checkout@v4 + - name: Install MSSQL + uses: potatoqualitee/mssqlsuite@v1.8 + with: + install: sqlengine, sqlclient + version: 2017-latest + sa-password: 'Password12!' + show-log: true + - name: Run Unit tests + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + composer update + ./vendor/bin/phpunit --configuration phpunit.sqlsrv.xml.dist + + tests-unit-windows: + name: Run Unit tests (Windows) + runs-on: windows-latest + needs: [code-style-php] + strategy: + matrix: + php_version: ['8.1', '8.2', '8.3'] + steps: + - uses: actions/checkout@v4 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php_version }} + extensions: openssl, mbstring, fileinfo, ftp + - name: Install MSSQL + uses: potatoqualitee/mssqlsuite@v1.8 + with: + install: sqlengine, sqlclient + version: 2017-latest + sa-password: 'Password12!' + show-log: true + - name: Install Composer dependencies + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + composer install --no-progress --ignore-platform-reqs + - name: Run Unit tests + run: php vendor/bin/phpunit -c phpunit.appveyor_sql2017.xml.dist diff --git a/.gitignore b/.gitignore index 397f02679..425fe5da3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,16 @@ -/.idea/ -build/ +# IDE Related Files # +.buildpath +.project +.settings +.DS_Store +.idea + +# Composer and test related files # vendor/ composer.phar composer.lock phpunit.xml -phpunit.*.xml -.phpunit.result.cache +.phpunit.cache/ +.idea/ +/.phpunit.result.cache +/.phpunit.cache/ diff --git a/.phan/config.php b/.phan/config.php deleted file mode 100644 index 333c1b145..000000000 --- a/.phan/config.php +++ /dev/null @@ -1,350 +0,0 @@ - '8.1', - - // If enabled, missing properties will be created when - // they are first seen. If false, we'll report an - // error message if there is an attempt to write - // to a class property that wasn't explicitly - // defined. - 'allow_missing_properties' => true, - - // If enabled, null can be cast to any type and any - // type can be cast to null. Setting this to true - // will cut down on false positives. - 'null_casts_as_any_type' => true, - - // If enabled, allow null to be cast as any array-like type. - // - // This is an incremental step in migrating away from `null_casts_as_any_type`. - // If `null_casts_as_any_type` is true, this has no effect. - 'null_casts_as_array' => true, - - // If enabled, allow any array-like type to be cast to null. - // This is an incremental step in migrating away from `null_casts_as_any_type`. - // If `null_casts_as_any_type` is true, this has no effect. - 'array_casts_as_null' => true, - - // If enabled, scalars (int, float, bool, string, null) - // are treated as if they can cast to each other. - // This does not affect checks of array keys. See `scalar_array_key_cast`. - 'scalar_implicit_cast' => true, - - // If enabled, any scalar array keys (int, string) - // are treated as if they can cast to each other. - // E.g. `array` can cast to `array` and vice versa. - // Normally, a scalar type such as int could only cast to/from int and mixed. - 'scalar_array_key_cast' => true, - - // If this has entries, scalars (int, float, bool, string, null) - // are allowed to perform the casts listed. - // - // E.g. `['int' => ['float', 'string'], 'float' => ['int'], 'string' => ['int'], 'null' => ['string']]` - // allows casting null to a string, but not vice versa. - // (subset of `scalar_implicit_cast`) - 'scalar_implicit_partial' => [], - - // If enabled, Phan will warn if **any** type in a method invocation's object - // is definitely not an object, - // or if **any** type in an invoked expression is not a callable. - // Setting this to true will introduce numerous false positives - // (and reveal some bugs). - 'strict_method_checking' => false, - - // If enabled, Phan will warn if **any** type of the object expression for a property access - // does not contain that property. - 'strict_object_checking' => false, - - // If enabled, Phan will warn if **any** type in the argument's union type - // cannot be cast to a type in the parameter's expected union type. - // Setting this to true will introduce numerous false positives - // (and reveal some bugs). - 'strict_param_checking' => false, - - // If enabled, Phan will warn if **any** type in a property assignment's union type - // cannot be cast to a type in the property's declared union type. - // Setting this to true will introduce numerous false positives - // (and reveal some bugs). - 'strict_property_checking' => false, - - // If enabled, Phan will warn if **any** type in a returned value's union type - // cannot be cast to the declared return type. - // Setting this to true will introduce numerous false positives - // (and reveal some bugs). - 'strict_return_checking' => false, - - // If true, seemingly undeclared variables in the global - // scope will be ignored. - // - // This is useful for projects with complicated cross-file - // globals that you have no hope of fixing. - 'ignore_undeclared_variables_in_global_scope' => true, - - // Set this to false to emit `PhanUndeclaredFunction` issues for internal functions that Phan has signatures for, - // but aren't available in the codebase, or from Reflection. - // (may lead to false positives if an extension isn't loaded) - // - // If this is true(default), then Phan will not warn. - // - // Even when this is false, Phan will still infer return values and check parameters of internal functions - // if Phan has the signatures. - 'ignore_undeclared_functions_with_known_signatures' => true, - - // Backwards Compatibility Checking. This is slow - // and expensive, but you should consider running - // it before upgrading your version of PHP to a - // new version that has backward compatibility - // breaks. - // - // If you are migrating from PHP 5 to PHP 7, - // you should also look into using - // [php7cc (no longer maintained)](https://github.com/sstalle/php7cc) - // and [php7mar](https://github.com/Alexia/php7mar), - // which have different backwards compatibility checks. - // - // If you are still using versions of php older than 5.6, - // `PHP53CompatibilityPlugin` may be worth looking into if you are not running - // syntax checks for php 5.3 through another method such as - // `InvokePHPNativeSyntaxCheckPlugin` (see .phan/plugins/README.md). - 'backward_compatibility_checks' => false, - - // If true, check to make sure the return type declared - // in the doc-block (if any) matches the return type - // declared in the method signature. - 'check_docblock_signature_return_type_match' => true, - - // This setting maps case-insensitive strings to union types. - // - // This is useful if a project uses phpdoc that differs from the phpdoc2 standard. - // - // If the corresponding value is the empty string, - // then Phan will ignore that union type (E.g. can ignore 'the' in `@return the value`) - // - // If the corresponding value is not empty, - // then Phan will act as though it saw the corresponding UnionTypes(s) - // when the keys show up in a UnionType of `@param`, `@return`, `@var`, `@property`, etc. - // - // This matches the **entire string**, not parts of the string. - // (E.g. `@return the|null` will still look for a class with the name `the`, but `@return the` will be ignored with the below setting) - // - // (These are not aliases, this setting is ignored outside of doc comments). - // (Phan does not check if classes with these names exist) - // - // Example setting: `['unknown' => '', 'number' => 'int|float', 'char' => 'string', 'long' => 'int', 'the' => '']` - 'phpdoc_type_mapping' => [], - - // Set to true in order to attempt to detect dead - // (unreferenced) code. Keep in mind that the - // results will only be a guess given that classes, - // properties, constants and methods can be referenced - // as variables (like `$class->$property` or - // `$class->$method()`) in ways that we're unable - // to make sense of. - // - // To more aggressively detect dead code, - // you may want to set `dead_code_detection_prefer_false_negative` to `false`. - 'dead_code_detection' => false, - - // Set to true in order to attempt to detect unused variables. - // `dead_code_detection` will also enable unused variable detection. - // - // This has a few known false positives, e.g. for loops or branches. - 'unused_variable_detection' => false, - - // Set to true in order to attempt to detect redundant and impossible conditions. - // - // This has some false positives involving loops, - // variables set in branches of loops, and global variables. - 'redundant_condition_detection' => false, - - // If enabled, Phan will act as though it's certain of real return types of a subset of internal functions, - // even if those return types aren't available in reflection (real types were taken from php 7.3 or 8.0-dev, depending on target_php_version). - // - // Note that with php 7 and earlier, php would return null or false for many internal functions if the argument types or counts were incorrect. - // As a result, enabling this setting with target_php_version 8.0 may result in false positives for `--redundant-condition-detection` when codebases also support php 7.x. - 'assume_real_types_for_internal_functions' => false, - - // If true, this runs a quick version of checks that takes less - // time at the cost of not running as thorough - // of an analysis. You should consider setting this - // to true only when you wish you had more **undiagnosed** issues - // to fix in your code base. - // - // In quick-mode the scanner doesn't rescan a function - // or a method's code block every time a call is seen. - // This means that the problem here won't be detected: - // - // ```php - // false, - - // Override to hardcode existence and types of (non-builtin) globals in the global scope. - // Class names should be prefixed with `\`. - // - // (E.g. `['_FOO' => '\FooClass', 'page' => '\PageClass', 'userId' => 'int']`) - 'globals_type_map' => [], - - // The minimum severity level to report on. This can be - // set to `Issue::SEVERITY_LOW`, `Issue::SEVERITY_NORMAL` or - // `Issue::SEVERITY_CRITICAL`. Setting it to only - // critical issues is a good place to start on a big - // sloppy mature code base. - 'minimum_severity' => Issue::SEVERITY_NORMAL, - - // Add any issue types (such as `'PhanUndeclaredMethod'`) - // to this list to inhibit them from being reported. - // 'PhanDeprecatedClass', 'PhanUndeclaredConstant','PhanDeprecatedFunction' - 'suppress_issue_types' => [], - - // A regular expression to match files to be excluded - // from parsing and analysis and will not be read at all. - // - // This is useful for excluding groups of test or example - // directories/files, unanalyzable files, or files that - // can't be removed for whatever reason. - // (e.g. `'@Test\.php$@'`, or `'@vendor/.*/(tests|Tests)/@'`) - 'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@', - - // A list of files that will be excluded from parsing and analysis - // and will not be read at all. - // - // This is useful for excluding hopelessly unanalyzable - // files that can't be removed for whatever reason. - 'exclude_file_list' => [ - ], - - // A directory list that defines files that will be excluded - // from static analysis, but whose class and method - // information should be included. - // - // Generally, you'll want to include the directories for - // third-party code (such as "vendor/") in this list. - // - // n.b.: If you'd like to parse but not analyze 3rd - // party code, directories containing that code - // should be added to the `directory_list` as well as - // to `exclude_analysis_directory_list`. - 'exclude_analysis_directory_list' => [ - 'vendor/' - ], - - // Enable this to enable checks of require/include statements referring to valid paths. - // The settings `include_paths` and `warn_about_relative_include_statement` affect the checks. - 'enable_include_path_checks' => false, - - // The number of processes to fork off during the analysis - // phase. - 'processes' => 1, - - // List of case-insensitive file extensions supported by Phan. - // (e.g. `['php', 'html', 'htm']`) - 'analyzed_file_extensions' => [ - 'php', - ], - - // You can put paths to stubs of internal extensions in this config option. - // If the corresponding extension is **not** loaded, then Phan will use the stubs instead. - // Phan will continue using its detailed type annotations, - // but load the constants, classes, functions, and classes (and their Reflection types) - // from these stub files (doubling as valid php files). - // Use a different extension from php to avoid accidentally loading these. - // The `tools/make_stubs` script can be used to generate your own stubs (compatible with php 7.0+ right now) - // - // (e.g. `['xdebug' => '.phan/internal_stubs/xdebug.phan_php']`) - 'autoload_internal_extension_signatures' => [ - 'zip' => '.phan/zip.phan_php' - ], - - // A list of plugin files to execute. - // - // Plugins which are bundled with Phan can be added here by providing their name (e.g. `'AlwaysReturnPlugin'`) - // - // Documentation about available bundled plugins can be found [here](https://github.com/phan/phan/tree/v4/.phan/plugins). - // - // Alternately, you can pass in the full path to a PHP file with the plugin's implementation (e.g. `'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php'`) - 'plugins' => [], - - // A list of directories that should be parsed for class and - // method information. After excluding the directories - // defined in `exclude_analysis_directory_list`, the remaining - // files will be statically analyzed for errors. - // - // Thus, both first-party and third-party code being used by - // your application should be included in this list. - 'directory_list' => [ - 'src', - 'vendor' - ], - - // A list of individual files to include in analysis - // with a path relative to the root directory of the - // project. - 'file_list' => [], -]; diff --git a/.phan/zip.phan_php b/.phan/zip.phan_php deleted file mode 100644 index 61854874e..000000000 --- a/.phan/zip.phan_php +++ /dev/null @@ -1,145 +0,0 @@ - Date: Wed, 2 Jul 2025 23:50:10 +0200 Subject: [PATCH 02/10] Switching to Github Actions for CI --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 912e3fce7..c98dd30c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: ./vendor/bin/phpstan --error-format=github tests-unit-sqlite: - name: Run Unit tests + name: Run Unit tests on SQLite runs-on: ubuntu-latest container: joomlaprojects/docker-images:php${{ matrix.php_version }} needs: [code-style-php] @@ -78,7 +78,7 @@ jobs: ./vendor/bin/phpunit --configuration phpunit.sqlite.xml.dist tests-unit-mysql: - name: Run Unit tests + name: Run Unit tests on MySQL runs-on: ubuntu-latest container: joomlaprojects/docker-images:php${{ matrix.php_version }} needs: [code-style-php] @@ -104,7 +104,7 @@ jobs: MYSQL_DATABASE: test_joomla tests-unit-mariadb: - name: Run Unit tests + name: Run Unit tests on MariaDB runs-on: ubuntu-latest container: joomlaprojects/docker-images:php${{ matrix.php_version }} needs: [code-style-php] @@ -128,7 +128,7 @@ jobs: MARIADB_DATABASE: test_joomla tests-unit-postgres: - name: Run Unit tests + name: Run Unit tests on PostgreSQL runs-on: ubuntu-latest container: joomlaprojects/docker-images:php${{ matrix.php_version }} needs: [code-style-php] @@ -152,7 +152,7 @@ jobs: POSTGRES_DB: test_joomla tests-unit-sqlsrv: - name: Run Unit tests + name: Run Unit tests on SQLsrv runs-on: ubuntu-latest container: joomlaprojects/docker-images:php${{ matrix.php_version }} needs: [code-style-php] @@ -165,7 +165,7 @@ jobs: uses: potatoqualitee/mssqlsuite@v1.8 with: install: sqlengine, sqlclient - version: 2017-latest + version: 2017 sa-password: 'Password12!' show-log: true - name: Run Unit tests @@ -175,7 +175,7 @@ jobs: ./vendor/bin/phpunit --configuration phpunit.sqlsrv.xml.dist tests-unit-windows: - name: Run Unit tests (Windows) + name: Run Unit tests on MSSQL (Windows) runs-on: windows-latest needs: [code-style-php] strategy: @@ -192,7 +192,7 @@ jobs: uses: potatoqualitee/mssqlsuite@v1.8 with: install: sqlengine, sqlclient - version: 2017-latest + version: 2017 sa-password: 'Password12!' show-log: true - name: Install Composer dependencies From 7d1fb4d8068eece0acd7a7df3157959a7258e972 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Thu, 3 Jul 2025 09:43:27 +0200 Subject: [PATCH 03/10] Fixes --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c98dd30c4..874a8c35d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,7 +100,7 @@ jobs: env: MYSQL_USER: joomla_ut MYSQL_PASSWORD: joomla_ut - MYSQL_ROOT_PASSWORD: joomla_ut + MYSQL_ROOT_PASSWORD: '' MYSQL_DATABASE: test_joomla tests-unit-mariadb: @@ -124,8 +124,8 @@ jobs: env: MARIADB_USER: joomla_ut MARIADB_PASSWORD: joomla_ut - MARIADB_ROOT_PASSWORD: joomla_ut - MARIADB_DATABASE: test_joomla + MARIADB_ROOT_PASSWORD: '' + MARIADB_DATABASE: joomla_ut tests-unit-postgres: name: Run Unit tests on PostgreSQL @@ -145,7 +145,7 @@ jobs: ./vendor/bin/phpunit --configuration phpunit.pgsql.xml.dist services: postgres: - image: postgres:{{ matrix.db_version }}-alpine + image: postgres:${{ matrix.db_version }}-alpine env: POSTGRES_USER: root POSTGRES_PASSWORD: joomla_ut From 77135e251422a55771803a9f65b293c110c8d1c0 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Thu, 3 Jul 2025 10:18:59 +0200 Subject: [PATCH 04/10] Fixes --- .github/workflows/ci.yml | 2 +- phpunit.mysqli.xml.dist | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 874a8c35d..985d87141 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,7 +119,7 @@ jobs: composer update ./vendor/bin/phpunit --configuration phpunit.mariadb.xml.dist services: - mysql: + mariadb: image: mariadb:10.2 env: MARIADB_USER: joomla_ut diff --git a/phpunit.mysqli.xml.dist b/phpunit.mysqli.xml.dist index 5fcba50bb..d0c5fe934 100644 --- a/phpunit.mysqli.xml.dist +++ b/phpunit.mysqli.xml.dist @@ -2,7 +2,7 @@ - + From 634ef40142b54388a1478e661c56afce15d1adf2 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Thu, 3 Jul 2025 10:28:48 +0200 Subject: [PATCH 05/10] Fixes 3 --- .github/workflows/ci.yml | 8 ++++---- ..._sql2017.xml.dist => phpunit.appveyor_sql2019.xml.dist | 2 +- phpunit.mariadb.xml.dist | 4 ++-- phpunit.mysql.xml.dist | 4 ++-- phpunit.mysqli.xml.dist | 4 ++-- phpunit.sqlsrv.xml.dist | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) rename phpunit.appveyor_sql2017.xml.dist => phpunit.appveyor_sql2019.xml.dist (90%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 985d87141..cbb295112 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,7 +101,7 @@ jobs: MYSQL_USER: joomla_ut MYSQL_PASSWORD: joomla_ut MYSQL_ROOT_PASSWORD: '' - MYSQL_DATABASE: test_joomla + MYSQL_DATABASE: joomla_ut tests-unit-mariadb: name: Run Unit tests on MariaDB @@ -165,7 +165,7 @@ jobs: uses: potatoqualitee/mssqlsuite@v1.8 with: install: sqlengine, sqlclient - version: 2017 + version: 2019 sa-password: 'Password12!' show-log: true - name: Run Unit tests @@ -192,7 +192,7 @@ jobs: uses: potatoqualitee/mssqlsuite@v1.8 with: install: sqlengine, sqlclient - version: 2017 + version: 2019 sa-password: 'Password12!' show-log: true - name: Install Composer dependencies @@ -200,4 +200,4 @@ jobs: git config --global --add safe.directory $GITHUB_WORKSPACE composer install --no-progress --ignore-platform-reqs - name: Run Unit tests - run: php vendor/bin/phpunit -c phpunit.appveyor_sql2017.xml.dist + run: php vendor/bin/phpunit -c phpunit.appveyor_sql2019.xml.dist diff --git a/phpunit.appveyor_sql2017.xml.dist b/phpunit.appveyor_sql2019.xml.dist similarity index 90% rename from phpunit.appveyor_sql2017.xml.dist rename to phpunit.appveyor_sql2019.xml.dist index f6dbd3af7..b1f39f1f7 100644 --- a/phpunit.appveyor_sql2017.xml.dist +++ b/phpunit.appveyor_sql2019.xml.dist @@ -2,7 +2,7 @@ - + diff --git a/phpunit.mariadb.xml.dist b/phpunit.mariadb.xml.dist index 53115c576..7e8cd1053 100644 --- a/phpunit.mariadb.xml.dist +++ b/phpunit.mariadb.xml.dist @@ -4,8 +4,8 @@ - - + + diff --git a/phpunit.mysql.xml.dist b/phpunit.mysql.xml.dist index c291134ba..5560792b3 100644 --- a/phpunit.mysql.xml.dist +++ b/phpunit.mysql.xml.dist @@ -4,8 +4,8 @@ - - + + diff --git a/phpunit.mysqli.xml.dist b/phpunit.mysqli.xml.dist index d0c5fe934..93178ed94 100644 --- a/phpunit.mysqli.xml.dist +++ b/phpunit.mysqli.xml.dist @@ -4,8 +4,8 @@ - - + + diff --git a/phpunit.sqlsrv.xml.dist b/phpunit.sqlsrv.xml.dist index e00184823..78071eab5 100644 --- a/phpunit.sqlsrv.xml.dist +++ b/phpunit.sqlsrv.xml.dist @@ -2,7 +2,7 @@ - + From 1139653828c39dc2d7d36b2e2e49ff4705feb26c Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Thu, 3 Jul 2025 10:44:33 +0200 Subject: [PATCH 06/10] Fixes 4 --- .github/workflows/ci.yml | 20 ++++++++++++-------- phpunit.sqlsrv.xml.dist | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cbb295112..ba243ae7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -161,18 +161,22 @@ jobs: php_version: ['8.1', '8.2', '8.3'] steps: - uses: actions/checkout@v4 - - name: Install MSSQL - uses: potatoqualitee/mssqlsuite@v1.8 - with: - install: sqlengine, sqlclient - version: 2019 - sa-password: 'Password12!' - show-log: true - name: Run Unit tests run: | git config --global --add safe.directory $GITHUB_WORKSPACE + pecl install sqlsrv && docker-php-ext-enable sqlsrv + pecl install pdo_sqlsrv && docker-php-ext-enable pdo_sqlsrv + php --ri sqlsrv + php --ri pdo_sqlsrv composer update ./vendor/bin/phpunit --configuration phpunit.sqlsrv.xml.dist + services: + sqlsrv: + image: mcr.microsoft.com/mssql/server:2017-latest + env: + SA_PASSWORD: Password12! + ACCEPT_EULA: Y + MSSQL_PID: Developer tests-unit-windows: name: Run Unit tests on MSSQL (Windows) @@ -187,7 +191,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php_version }} - extensions: openssl, mbstring, fileinfo, ftp + extensions: openssl, mbstring, fileinfo, ftp, sqlsrv - name: Install MSSQL uses: potatoqualitee/mssqlsuite@v1.8 with: diff --git a/phpunit.sqlsrv.xml.dist b/phpunit.sqlsrv.xml.dist index 78071eab5..e00184823 100644 --- a/phpunit.sqlsrv.xml.dist +++ b/phpunit.sqlsrv.xml.dist @@ -2,7 +2,7 @@ - + From 6c7554284a449005de2395d09af6abc87f1ccfc8 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Thu, 3 Jul 2025 10:57:18 +0200 Subject: [PATCH 07/10] Fixes 5 --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba243ae7f..d23e0c85f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,6 +164,8 @@ jobs: - name: Run Unit tests run: | git config --global --add safe.directory $GITHUB_WORKSPACE + apt-get update + apt-get install -y software-properties-common lsb-release gnupg pecl install sqlsrv && docker-php-ext-enable sqlsrv pecl install pdo_sqlsrv && docker-php-ext-enable pdo_sqlsrv php --ri sqlsrv From addc1affeb70c233fd775757ae1c8c69a635b0e4 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Thu, 3 Jul 2025 11:00:46 +0200 Subject: [PATCH 08/10] Fixes 6 --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d23e0c85f..feff73b09 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -166,6 +166,10 @@ jobs: git config --global --add safe.directory $GITHUB_WORKSPACE apt-get update apt-get install -y software-properties-common lsb-release gnupg + curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - + echo "deb [arch=amd64,armhf,arm64] https://packages.microsoft.com/ubuntu/22.04/prod jammy main" >> /etc/apt/sources.list + apt-get update + ACCEPT_EULA=Y apt-get install -y msodbcsql18 unixodbc-dev pecl install sqlsrv && docker-php-ext-enable sqlsrv pecl install pdo_sqlsrv && docker-php-ext-enable pdo_sqlsrv php --ri sqlsrv From 2017ebad1aaa38759ed89240302a6d7044d62460 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Thu, 3 Jul 2025 11:07:54 +0200 Subject: [PATCH 09/10] Fixes 7 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index feff73b09..8a20fe5e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,7 +100,7 @@ jobs: env: MYSQL_USER: joomla_ut MYSQL_PASSWORD: joomla_ut - MYSQL_ROOT_PASSWORD: '' + MYSQL_ROOT_PASSWORD: joomla_ut MYSQL_DATABASE: joomla_ut tests-unit-mariadb: @@ -124,7 +124,7 @@ jobs: env: MARIADB_USER: joomla_ut MARIADB_PASSWORD: joomla_ut - MARIADB_ROOT_PASSWORD: '' + MARIADB_ROOT_PASSWORD: joomla_ut MARIADB_DATABASE: joomla_ut tests-unit-postgres: From e25c34a60041a96951959d0cda133e0ea9b4d240 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Thu, 3 Jul 2025 11:15:50 +0200 Subject: [PATCH 10/10] gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 425fe5da3..7b10e08e6 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,9 @@ vendor/ composer.phar composer.lock phpunit.xml +phpunit.*.xml .phpunit.cache/ .idea/ /.phpunit.result.cache /.phpunit.cache/ +/.github/