Open mrabbani opened 1 week ago
The changes encompass the introduction of a comprehensive testing framework for Dokan functionalities, utilizing PHPUnit. These modifications include new PSR-4 autoload mappings, updated scripts, new unit test files, helper classes, and factory classes for creating and managing test data like customers, orders, products, and more. Additionally, database assertion methods were added to facilitate robust testing.
Filename | Change Summary |
---|---|
composer.json |
Added PSR-4 autoload mapping for test namespace and scripts for running PHPUnit tests. |
docs/tdd/factories.md |
Introduced Dokan Factories for creating test data such as Products, Orders, Coupons, aiding unit testing efforts. |
docs/tdd/readme.md |
Added guidelines for Test-Driven Development (TDD), outlining workflow and test case instructions. |
phpunit.xml |
Updated paths in the configuration file for bootstrap and testsuite sections. |
tests/php/CustomFactoriesTest.php |
Added test methods for creating and verifying various entities within the Dokan system like orders and coupons. |
tests/php/DokanTestCase.php |
Introduced abstract class DokanTestCase for creating test fixtures and database state assertions. |
tests/php/src/Factories/... |
Added various factory classes (e.g., DokanFactory , CouponFactory ) for generating WooCommerce and Dokan test data. |
tests/php/src/Helpers/... |
Added helper classes for handling WooCommerce entities like coupons, customers, orders, and products in tests. |
tests/php/src/SampleTest.php |
Added namespace declaration and use statement for WP_UnitTestCase . |
tests/php/src/SellerTest.php |
Renamed test class from Dokan_Test_Seller to SellerTest and improved method formatting. |
tests/php/src/Vendor/UserToVendorTest.php |
New file added to test vendor data persistence for Dokan. |
tests/php/src/DBAssertionTrait.php |
New trait added to provide database assertion methods for unit testing Dokan entities. |
In the code where we reside,
New tests and helpers by our side.
From orders, products, sellers too,
Factories, now to help us through.
PHPUnit runs with cheer,
Ensuring Dokan's all clear.
🐇✨ Hoppy code, bugs disappear!
[!TIP]
Early access features
- OpenAI `gpt-4o` model for reviews and chat. Note: - You can disable early access features from the CodeRabbit UI or by setting `early_access: false` in the CodeRabbit configuration file. - Please join our [Discord Community](https://discord.com/invite/GsXnASn26c) to provide feedback and report issues. - OSS projects are always opted into early access features.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
All Submissions:
Changes proposed in this Pull Request:
Related Pull Request(s)
Closes
How to test the changes in this Pull Request:
Changelog entry
Title
Detailed Description of the pull request. What was previous behaviour and what will be changed in this PR.
Before Changes
Describe the issue before changes with screenshots(s).
After Changes
Describe the issue after changes with screenshot(s).
Feature Video (optional)
Link of detailed video if this PR is for a feature.
PR Self Review Checklist:
FOR PR REVIEWER ONLY:
Summary by CodeRabbit
New Features
Improvements
phpunit.xml
to enhance test configuration paths.Bug Fixes
Documentation