Skip to content
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

test: implement unit testing for post-type enrollment #5

Merged
merged 11 commits into from
Jul 4, 2023

Conversation

julianramirez2
Copy link
Contributor

@julianramirez2 julianramirez2 commented Jun 22, 2023

Description

A unit test was performed to verify that the creation of post-type objects was being done correctly for both auto-generated objects and those generated for each record entered as an "enrollment request".

Testing instructions

To test it within GitHub, we can review the phpunit GitHub Action and verify that this test passed. If we want to perform a manual review locally, follow these steps:

If composer is not installed:

  • Install Composer in the root folder of the plugin.
  • Install phpunit version 9.* using Composer.
  • Optional: Install xdebug to generate coverage test locally.
  • In the terminal, navigate to the root folder of the plugin.
  • Run the command php vendor/bin/phpunit --coverage-text test.

If composer is installed:

  • In the terminal, navigate to the root folder of the plugin.
  • Run the command php vendor/bin/phpunit --coverage-text test.

Additional information

In case of doubts regarding the coverage values, they might be low because the code is tested using "mock" objects. These are simulated objects that contain the functionalities we want to prevent from being executed, mimicking the behavior of real objects in a controlled environment.

Checklist for Merge

  • Tested in a remote environment
  • Rebased master/main
  • Squashed commits

@jvegalo jvegalo changed the title Unit testing post type test: implement unit testing for post-type enrollment Jun 22, 2023
@MaferMazu
Copy link
Contributor

Hello, @julianramirez2; thank you for this PR. Please let me know when the test has passed so I can review this.

@julianramirez2 julianramirez2 force-pushed the unit-testing-post-type branch from edadeae to 4f334ef Compare June 23, 2023 00:11
@julianramirez2 julianramirez2 requested a review from MaferMazu June 28, 2023 23:59
@julianramirez2 julianramirez2 merged commit 5398e66 into main Jul 4, 2023
@felipemontoya felipemontoya deleted the unit-testing-post-type branch March 21, 2024 17:31
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.

3 participants