Commit 1ca2bb9
committed
Tests: Add comprehensive tests for helper and utility functions
Add 159 tests covering acf-helper-functions.php (136 tests) and
acf-utility-functions.php (23 tests) with 222 assertions total.
Helper function tests cover:
- acf_is_empty/acf_not_empty with numeric edge cases
- acf_uniqid counter and prefix behavior
- acf_merge_attributes class/style concatenation
- Filter enable/disable/get/set operations
- acf_idval/acf_maybe_idval ID extraction
- acf_format_numerics/acf_numval type conversion
- acf_idify/acf_slugify/acf_punctify string formatting
- acf_strlen with line breaks and multibyte chars
- acf_sanitize_request_args type handling and XSS prevention
- acf_sanitize_files_array single and multiple file handling
- acf_maybe_unserialize with class blocking security
Utility function tests cover:
- acf_new_instance/acf_get_instance singleton pattern
- acf_register_store/acf_get_store data management
- acf_get_path/acf_get_url path resolution
- acf_include path handling behavior
All tests use data providers for comprehensive edge case coverage
and include documentation for non-obvious behavior.1 parent ab02e04 commit 1ca2bb9
File tree
2 files changed
+1417
-0
lines changed- tests/php/includes
2 files changed
+1417
-0
lines changed
0 commit comments