Closed imgerson closed 4 years ago
I'm sending two small changes in this PR:
_testPageLoaded()
createPost()
args
$args[ $key ]
$args[ $value ]
The fix 2 will benefit users by re-enabling them to override default arguments when creating a post.
None that I'm aware of.
I first realized of the typo on createPost when I was trying to create a post on a custom post type with something similar to:
createPost
$this->createPost( array( 'post_title' => 'My custom post type', 'post_name' => 'custom-post-title', 'post_type' => 'my-cpt' , ) );
This failed with Undefined index: Test Post.
Undefined index: Test Post
After implementing the changes in this PR for the createPost function I succeeded on creating the post.
_testPageLoaded
PS. There's no develop branch in this project. This is why I'm aiming for master.
develop
master
Awesome. Thank you!
Description of the Change
I'm sending two small changes in this PR:
_testPageLoaded()
at https://github.com/10up/wpacceptance/blob/8ec700bd4aba8694b9c1c5ed2a82215821225428/src/classes/PHPUnit/StandardTests/Frontend.phpcreatePost()
at https://github.com/10up/wpacceptance/blob/7c2b19b60164a1f63d89aa774fb786eef0502f26/src/classes/PHPUnit/Database.php — the value of theargs
received by the function should be accessed through$args[ $key ]
as in line 414, instead of$args[ $value ]
as it currently is on line 416.Benefits
The fix 2 will benefit users by re-enabling them to override default arguments when creating a post.
Possible Drawbacks
None that I'm aware of.
Verification Process
I first realized of the typo on
createPost
when I was trying to create a post on a custom post type with something similar to:This failed with
Undefined index: Test Post
.After implementing the changes in this PR for the
createPost
function I succeeded on creating the post.Checklist:
Changelog Entry
createPost()
_testPageLoaded
standard testPS. There's no
develop
branch in this project. This is why I'm aiming formaster
.