Skip to content

feat(CPD-32641): support PHPUnit 10 through 12 - #80

Merged
sallainternalbot[bot] merged 15 commits into
masterfrom
feature/CPD-32641-upgrade-zatca-to-laravel-13-v2
Oct 6, 2026
Merged

sallainternalbot[bot] merged 15 commits into
masterfrom
feature/CPD-32641-upgrade-zatca-to-laravel-13-v2

Conversation

@thaifanisalla

@thaifanisalla thaifanisalla commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Part of the zatca-einvoicing Laravel 13 upgrade (CPD-32641).

What kind of change does this PR introduce?

Test tooling fix. No production code is touched.

What is the current behaviour?

Every test method in this suite is marked with /** @test */. PHPUnit 12 removed metadata in doc-comments, so those methods are no longer collected — the suite does not fail, it reports nothing. Consumers that run the package tests as part of their own suite (zatca-einvoicing includes vendor/salla/zatca/tests in its phpunit.xml) went from 8 ZATCA tests to 0 without any signal while upgrading to Laravel 13 / PHPUnit 12.

phpunit.xml is also PHPUnit 8/9-era: backupStaticAttributes, verbose, convertErrorsToExceptions, convertNoticesToExceptions, convertWarningsToExceptions and filter/whitelist were all removed in PHPUnit 10, so the config itself will not load there.

What is the new behaviour?

  • the 8 test methods across SignInvoiceTest, GenerateCSRTest and GenerateQrCodeTest use #[Test]
  • phpunit/phpunit moves from ~8.0 to ^10.5|^11.5|^12.0
  • phpunit.xml is rewritten for the PHPUnit 10+ schema (filter/whitelist → <source>). The gating the removed convert*ToExceptions flags provided is kept through their PHPUnit 10+ equivalents, failOnNotice and failOnWarning, so a notice or warning still fails the build
  • cacheDirectory is set (and gitignored) so PHPUnit stops warning about the default cache location

Verified locally: 8 tests, 26 assertions green on PHPUnit 12.5.35 / PHP 8.3, with failOnNotice/failOnWarning active — previously 0 collected.

PHP requirement

Unchanged: require.php stays >=8.0. src/ and tests/ both lint clean on php:8.0-cli, so the consumer-facing floor has no reason to move — that contract describes what the library runs on, not what its test tooling needs.

Developing the package does now need PHP 8.1, because phpunit/phpunit ^10.5 is the lowest line that reads attribute metadata. require-dev is root-only, so this affects contributors on an end-of-life runtime, not anyone installing the package.

(The sibling PR SallaApp/E-Invoicing#30 does raise its floor to >=8.1 — that package's src/ declares final public const and fatals on 8.0, so its >=8.0 was already inaccurate. This one is genuinely 8.0-clean.)

Does this PR introduce a breaking change?

No. Test-only; the published src/ and the declared PHP floor are both unchanged.

Follow-up

zatca-einvoicing pins salla/zatca: ~3.0 (locked at 3.0.5) while master is tagged 4.0.1, so this fix needs either a 3.0.x patch release or a decision to move that app to ^4.0.

Related

  • SallaApp/zatca-einvoicing#367 — the Laravel 13 upgrade that depends on this (it aliases dev-feature/CPD-32641-upgrade-zatca-to-laravel-13-v2 until this is tagged)

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable issue was identified.

Summary

The PR updates the package’s test tooling for PHPUnit 10–12 without changing production code or the declared PHP runtime requirement.

  • Replaces doc-comment test markers with #[Test] attributes across eight test methods.
  • Updates the PHPUnit dependency constraint and configuration, and ignores PHPUnit cache files.
  • Greptile automatically discovered a related ticket that helped explain the purpose of this PR: verifying ZATCA compatibility as part of the Laravel 13 upgrade.

Reviews (11) · Last reviewed commit: "chore: trigger unit tests [utest]"

PHPUnit 12 removed doc-comment metadata. Every test in this package is
marked with `/** @test */`, so under PHPUnit 10 or newer none of the 8
tests is collected any more: the suite reports success while running
nothing, both here and in every application that includes this package's
tests in its own suite. Replace the annotation with the `#[Test]`
attribute, supported since PHPUnit 10.

require-dev pinned phpunit/phpunit at ~8.0, which cannot be installed
alongside a modern application; widen it to ^10.5|^11.5|^12.0. PHPUnit
10.5 needs PHP 8.1, but that is a require-dev concern only: this
package's src/ and tests/ both lint clean on php:8.0-cli, so require.php
stays at the consumer floor of 8.0. A dev install needs PHP 8.1, which
is where the supported PHPUnit line starts.

phpunit.xml is rewritten for the PHPUnit 10+ schema: the removed
attributes (backupStaticAttributes, verbose, convertErrorsToExceptions
and friends) are dropped and the filter/whitelist block becomes
`<source>`. The gating those convert* flags provided is kept through
their PHPUnit 10+ equivalents, failOnNotice and failOnWarning, so a
notice or warning still fails the build.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication ✅ 0 (≤ 2 duplication)

View in Codacy

AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@thaifanisalla
thaifanisalla marked this pull request as ready for review September 27, 2026 14:19
@thaifanisalla
thaifanisalla requested a review from a team as a code owner September 27, 2026 14:19
@thaifanisalla thaifanisalla changed the title test(CPD-32641): support PHPUnit 10 through 12 feat(CPD-32641): support PHPUnit 10 through 12 Sep 27, 2026
@thaifanisalla

Copy link
Copy Markdown
Contributor Author

/utest

@sallainternalbot

Copy link
Copy Markdown

Unit Test Trigger Summary

Triggered PRs:

@ahmed3mar

Copy link
Copy Markdown
Member

/canmerge

@sallainternalbot

sallainternalbot Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

⚠️ Merge Blocked

I wasn't able to complete the merge due to the following issues:

👥 Missing Required Approvals

These PRs need to be approved by reviewers:

Please request review and ensure all approvals are completed.


🎫 Missing or Invalid Ticket ID

The following PRs do not have a valid ticket ID in their title or branch name, or do not follow branch naming conventions:

Please add a valid ticket ID (e.g., PROJ-123) and ensure branch naming conventions are followed.


⏰ Dependency PR Checks Are Stale

The following dependency PRs have commits newer than the latest test run on this PR. The test results may not reflect the current state of dependencies:

Please re-run the test workflow or push a new commit to the main PR to trigger fresh checks.


Once all issues are resolved, you can try the merge again.
If anything seems off, feel free to ask for help — I've got your back! 🤖

@EngRashaAmer

Copy link
Copy Markdown
Contributor

/merge

@sallainternalbot

Copy link
Copy Markdown

⚠️ Merge Blocked

I wasn't able to complete the merge due to the following issues:

⏰ Dependency PR Checks Are Stale

The following dependency PRs have commits newer than the latest test run on this PR. The test results may not reflect the current state of dependencies:

Please re-run the test workflow or push a new commit to the main PR to trigger fresh checks.


Once all issues are resolved, you can try the merge again.
If anything seems off, feel free to ask for help — I've got your back! 🤖

@EngRashaAmer

Copy link
Copy Markdown
Contributor

/merge

@sallainternalbot

Copy link
Copy Markdown

⚠️ Merge Blocked

I wasn't able to complete the merge due to the following issues:

⏰ Dependency PR Checks Are Stale

The following dependency PRs have commits newer than the latest test run on this PR. The test results may not reflect the current state of dependencies:

Please re-run the test workflow or push a new commit to the main PR to trigger fresh checks.


Once all issues are resolved, you can try the merge again.
If anything seems off, feel free to ask for help — I've got your back! 🤖

@EngRashaAmer

Copy link
Copy Markdown
Contributor

/merge

@sallainternalbot

Copy link
Copy Markdown

⚠️ Merge Blocked

I wasn't able to complete the merge due to the following issues:

⏰ Dependency PR Checks Are Stale

The following dependency PRs have commits newer than the latest test run on this PR. The test results may not reflect the current state of dependencies:

Please re-run the test workflow or push a new commit to the main PR to trigger fresh checks.


Once all issues are resolved, you can try the merge again.
If anything seems off, feel free to ask for help — I've got your back! 🤖

@thaifanisalla

Copy link
Copy Markdown
Contributor Author

/utest

@sallainternalbot

Copy link
Copy Markdown

Unit Test Trigger Summary

Triggered PRs:

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication ✅ 0 (≤ 2 duplication)

View in Codacy

AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@Mustafa-Azzam-Salla

Copy link
Copy Markdown

/utest

@sallainternalbot

Copy link
Copy Markdown

Unit Test Trigger Summary

Triggered PRs:

@thaifanisalla

Copy link
Copy Markdown
Contributor Author

/utest

@sallainternalbot

Copy link
Copy Markdown

Unit Test Trigger Summary

Triggered PRs:

@maqalaqil

Copy link
Copy Markdown
Contributor

/merge --bypass

@sallainternalbot
sallainternalbot Bot merged commit 715f042 into master Oct 6, 2026
4 checks passed
@sallainternalbot

Copy link
Copy Markdown

The file composer.json detected in #80. Waiting for composer version to be available

@sallainternalbot
sallainternalbot Bot deleted the feature/CPD-32641-upgrade-zatca-to-laravel-13-v2 branch October 6, 2026 10:12
@sallainternalbot

Copy link
Copy Markdown

Failed to bypass merge: failed to bypass merge: failed to find version for #80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants