Skip to content

Add unit tests with Brain Monkey #3

@shazzad

Description

@shazzad

Summary

Add unit tests using Brain Monkey and Mockery to verify core logic without requiring a running WordPress environment.

Changes

  • Add brain/monkey and mockery/mockery as dev dependencies
  • Add phpunit.xml.dist configuration and test bootstrap
  • Add unit tests covering:
    • Integration license methodsget_license_option(), get_license_code(), has_license_code(), is_license_active()
    • Integration transient managementclear_updates_transient() (move, create, initialize)
    • Integration API requestsapi_request() success/error paths, license params, fixture parsing
    • Updater pre_set_transient — version comparison, response/no_update management, error handling
  • Add .gitattributes to exclude tests from distribution packages
  • Update README installation instructions to use composer require

Verification

composer test

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions