Skip to content

Feature/increase coverage#68

Merged
erseco merged 3 commits intomainfrom
feature/increase-coverage2
Dec 1, 2025
Merged

Feature/increase coverage#68
erseco merged 3 commits intomainfrom
feature/increase-coverage2

Conversation

@erseco
Copy link
Copy Markdown
Collaborator

@erseco erseco commented Dec 1, 2025

This pull request adds extensive new unit tests to improve coverage and reliability for several core components of the Documentate plugin. The most important changes include new test cases for document generation, demo data creation, and admin helper functionality, as well as updates to the .gitattributes file to exclude additional files from exports.

Test Coverage Improvements

Document Generation Tests (tests/unit/includes/DocumentateDocumentGeneratorTest.php):

  • Added tests for generating DOCX and ODT documents using real template files, verifying file creation and error handling.
  • Added tests for template path resolution for both DOCX and ODT types.
  • Added tests for building merge fields from document data and for generating documents with a comprehensive template.
  • Added tests for field value preparation, including date-time and empty values.

Demo Data Tests (tests/unit/includes/DocumentateDemoDataTest.php):

  • Introduced a new test class for Documentate_Demo_Data, covering alert setting, preservation of existing options, permission handling, user restoration, and translatability of alert messages.

Admin Helper Tests (tests/unit/includes/DocumentateAdminHelperTest.php):

  • Added multiple tests for DocumentateAdminHelper, including post ID retrieval from GET/global, script string and config generation, conversion mode config, and existence of key handler methods.
  • Validated that script string values are non-empty strings and that config preservation works as expected.

Build and Packaging

Export Ignore Updates (.gitattributes):

  • Updated the .gitattributes file to exclude additional documentation, configuration, and artifact files from export builds, ensuring cleaner package distributions.

@erseco erseco self-assigned this Dec 1, 2025
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.20%. Comparing base (475d754) to head (bff0142).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main      #68      +/-   ##
============================================
+ Coverage     75.96%   79.20%   +3.23%     
  Complexity     2405     2405              
============================================
  Files            39       39              
  Lines          7232     7232              
============================================
+ Hits           5494     5728     +234     
+ Misses         1738     1504     -234     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@erseco erseco merged commit 8f6ec24 into main Dec 1, 2025
9 checks passed
@erseco erseco deleted the feature/increase-coverage2 branch December 1, 2025 05:53
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.

1 participant