Skip to content

Added PHPUnit For Testing Purposes#4

Open
zaimazhar wants to merge 2 commits intoxputerax:masterfrom
zaimazhar:add_test
Open

Added PHPUnit For Testing Purposes#4
zaimazhar wants to merge 2 commits intoxputerax:masterfrom
zaimazhar:add_test

Conversation

@zaimazhar
Copy link

@zaimazhar zaimazhar commented Mar 6, 2022

Added PHPUnit base tests for client and category

  • Base test cases for future addition. This PR corresponds to No unit test #3 for code consolidation and enhancement.

Versioning

  • PHP: 8.0.15
  • PHPUnit: ^9

Ongoing Issue

  • Most tests require requests to ToyyibPay's API, thus making it harder to mock both successful and failed tests without pasting your API key directly in the test files. My current solution to this issue would be making a config file to paste your API key in tests/config.php

Running Test

./vendor/bin/phpunit --bootstrap tests/config.php tests --testdox

Expected Result

image

Signed-off-by: ZAIM-WSL2 <zaim.azhar97@gmail.com>
Signed-off-by: ZAIM-WSL2 <zaim.azhar97@gmail.com>
@zaimazhar
Copy link
Author

Suggesting to make a dev branch for pull requests before pushing directly into main or master(yeet) branch.

@xputerax
Copy link
Owner

LMAO baru perasan. Thanks will review it

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.

2 participants