-
Notifications
You must be signed in to change notification settings - Fork 21
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
Form Post: Fix PHPStan and PHPCS issues. #81
Form Post: Fix PHPStan and PHPCS issues. #81
Conversation
tests/php/bootstrap.php
Outdated
@@ -13,3 +13,6 @@ | |||
|
|||
// Load our plugin. | |||
require dirname( dirname( __DIR__ ) ) . '/secure-custom-fields.php'; | |||
|
|||
// Load the ACF_Form_Post class. | |||
require dirname( dirname( __DIR__ ) ) . '/includes/forms/form-post.php'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you share your thought on adding it to the main bootstrap? My first thought without digging into anything would be to have this require within the test-form-post.php file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I required the file on the test one, as you mentioned. Honestly, I'm not 100% sure of the best approach for these unit tests. Let's see in the future for functions that require several files.
What
Part of #67
Refactor
form-post.php
file to follow PHPCS standards and PHPStan issues. I did manual testing and everything seems to be ok, but I would feel more comfortable if we plan some kind of unit or e2e testing.The riskiest change is removing
$postarr
fromwp_insert_post_empty_content
. However the variable is not being used inside the function.