mirror of
https://github.com/cypht-org/cypht.git
synced 2026-04-25 21:15:56 +03:00
[GH-ISSUE #1048] Rethinking Hm_Functions #561
Labels
No labels
2fa
I18N
PGP
Security
Security
account
advanced_search
advanced_search
announcement
api_login
authentication
awaiting feedback
blocker
bug
bug
bug
calendar
config
contacts
core
core
devops
docker
docs
duplicate
dynamic_login
enhancement
epic
feature
feeds
framework
github
github
gmail_contacts
good first issue
help wanted
history
history
imap
imap_folders
inline_message
installation
keyboard_shortcuts
keyboard_shortcuts
ldap_contacts
mobile
need-ssh-access
new module set
nux
pop3
profiles
pull-request
question
refactor
release
research
saved_searches
smtp
strategic
tags
tests
themes
website
wordpress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cypht#561
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @TheDigitalOrchard on GitHub (May 25, 2024).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/1048
Originally assigned to: @josaphatim on GitHub.
🗣 Suggestion
I'll start off by saying that my Unit Testing experience is very limited. As the sole developer for my projects, I haven't had the need to do a lot of package-wide unit testing, although I'm sure I'd get a lot of value if I finally did incorprate this best practice.
In
lib/framework.php, a class calledHm_Functionsis defined with a lot of methods that merely wrap around built-in functions, such asfunction_exists()andclass_exists(). Calling these results in two function calls, even though nothing of value is added by this.The explanation for this class is:
Can someone enlighten me as to how unit tests are broken by built-in functions? What is an example?
How is calling
Hm_Functions::function_exists()better than just calling the built-infunction_exists()?Let's start there. Help me understand this better. If there is a solid explanation for using this wrapping class, then I'll drop my suggestion for rethinking it.
(Yes, I'm a micro-optimization nut, so I'm always triggered by unnecessary function calls, pun intended)
Thanks.
@marclaporte commented on GitHub (May 26, 2024):
@josaphatim Please advise
@josaphatim commented on GitHub (Jun 9, 2024):
@TheDigitalOrchard I tried to replace calls of Hm_Functions::function_exists and Hm_Functions::class_exists by native functions: there was a total of 3 tests failed. It can be more if I replaced all methods in Hm_Functions. I will investigate more but of course Hm_Functions prevents to break unit test
@marclaporte commented on GitHub (Sep 28, 2024):
@josaphatim There has been lots of work in the last months. Any status changes here?
Thanks!
@marclaporte commented on GitHub (Sep 1, 2025):
@josaphatim we need you :-)