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

Tests: Add test resources for AspireUpdate\Debug #244

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

costdev
Copy link
Contributor

@costdev costdev commented Dec 19, 2024

Pull Request

What changed?

  • A new unit test case has been introduced: Debug_UnitTestCase.
  • A fake filesystem class to aid testing has been introduced: AP_FakeFilesystem.
    • This extends WP_Filesystem_Direct and currently overrides the ::exists(), ::is_readable(), and ::is_writable() methods.
  • Coding Standards: Some sniffs were previously excluded just for test classes. These have been expanded to all files in tests/phpunit/.
  • Coding Standards: Sniffs against native PHP functions for filesystem interaction have been excluded for files in tests/phpunit/.

Why did it change?

  • To make PHPUnit testing AspireUpdate\Debug consistent and easier.
  • To prevent coding standards errors and warnings for common and legitimate use in tests.

Did you fix any specific issues?

See #216

CERTIFICATION

By opening this pull request, I do agree to abide by the Code of Conduct and be bound by the terms of the Contribution Guidelines in effect on the date and time of my contribution as proven by the revision information in GitHub.

@costdev costdev marked this pull request as ready for review December 19, 2024 16:51
@namithj namithj requested review from namithj and a team and removed request for namithj December 19, 2024 16:54
@costdev costdev merged commit 056914f into aspirepress:main Dec 19, 2024
5 checks passed
@afragen
Copy link
Contributor

afragen commented Dec 19, 2024

Should we consider adding our basic functions for Reflection?

@costdev
Copy link
Contributor Author

costdev commented Dec 19, 2024

Sorry @afragen I missed this comment before merging. At this stage I think we're only using the Reflection API a few times. If we find that we end up using it more, then yeah I think we should definitely look at adding the basic helper functions we wrote for the Reflection API to the codebase.

@afragen
Copy link
Contributor

afragen commented Dec 19, 2024

I wrote the comment post-merge so don't worry. Just asking.

@costdev costdev deleted the tests_add_debug_test_resources branch December 19, 2024 23:38
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