Skip to content

test: add unit tests for GDHandler save and security exceptions#10414

Open
gr8man wants to merge 2 commits into
codeigniter4:developfrom
gr8man:test/gdhandler-save-coverage
Open

test: add unit tests for GDHandler save and security exceptions#10414
gr8man wants to merge 2 commits into
codeigniter4:developfrom
gr8man:test/gdhandler-save-coverage

Conversation

@gr8man

@gr8man gr8man commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description
Adds missing unit tests for GDHandler::save() and unsupported image types exceptions to improve code coverage.

Changes:

  • Added tests for file save failures using vfsStream.
  • Added a test for the save($target, 100) unmodified copy logic.
  • Added tests simulating an unsupported imageType to ensure ImageException is thrown instead of a fatal GD error.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@github-actions github-actions Bot added the testing Pull requests that changes tests only label Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Pull requests that changes tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant