Skip to content

Fix: Comprehensive improvements and test enhancements #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sedhossein
Copy link
Owner

This commit introduces several key improvements to the codebase:

  1. Updated PHP Version:

    • Raised the minimum PHP version requirement in composer.json from ^7.2 to ^7.4.
  2. CI Enhancements (.github/workflows/php.yml):

    • Configured the GitHub Actions workflow to explicitly use PHP 7.4.
    • Enabled the test suite execution step, which was previously commented out.
  3. Enabled Composer Test Script:

    • Added a test script (vendor/bin/phpunit) to composer.json to facilitate running tests.
  4. National Code Validation Tests (IsNationalCode):

    • Added comprehensive test cases for the IsNationalCode method in PregexTest.php, including valid (generated, non-real) and invalid scenarios.
    • Removed the @codeCoverageIgnore annotation from the IsNationalCode method in Pregex.php as it is now covered by tests.
  5. Test Naming Correction:

    • Corrected a data provider annotation in PregexTest.php: The test_valid_without_persian_alphabet method now correctly uses the valid_without_persian_alphabets data provider.

These changes improve the reliability of the library by ensuring tests are run in CI, modernize the PHP dependency, and increase test coverage.

This commit introduces several key improvements to the codebase:

1.  **Updated PHP Version:**
    - Raised the minimum PHP version requirement in `composer.json` from `^7.2` to `^7.4`.

2.  **CI Enhancements (`.github/workflows/php.yml`):**
    - Configured the GitHub Actions workflow to explicitly use PHP 7.4.
    - Enabled the test suite execution step, which was previously commented out.

3.  **Enabled Composer Test Script:**
    - Added a `test` script (`vendor/bin/phpunit`) to `composer.json` to facilitate running tests.

4.  **National Code Validation Tests (`IsNationalCode`):**
    - Added comprehensive test cases for the `IsNationalCode` method in `PregexTest.php`, including valid (generated, non-real) and invalid scenarios.
    - Removed the `@codeCoverageIgnore` annotation from the `IsNationalCode` method in `Pregex.php` as it is now covered by tests.

5.  **Test Naming Correction:**
    - Corrected a data provider annotation in `PregexTest.php`: The `test_valid_without_persian_alphabet` method now correctly uses the `valid_without_persian_alphabets` data provider.

These changes improve the reliability of the library by ensuring tests are run in CI, modernize the PHP dependency, and increase test coverage.
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