10up / wpacceptance

ARCHIVED: A team scalable solution for reliable WordPress acceptance testing.
https://wpacceptance.readthedocs.io/
MIT License
148 stars 15 forks source link

Fix small errors #18

Closed imgerson closed 4 years ago

imgerson commented 4 years ago

Description of the Change

I'm sending two small changes in this PR:

  1. Fix for a couple of typos inside _testPageLoaded() at https://github.com/10up/wpacceptance/blob/8ec700bd4aba8694b9c1c5ed2a82215821225428/src/classes/PHPUnit/StandardTests/Frontend.php
  2. Fix an array key typo in createPost() at https://github.com/10up/wpacceptance/blob/7c2b19b60164a1f63d89aa774fb786eef0502f26/src/classes/PHPUnit/Database.php — the value of the args 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->createPost( array( 
    'post_title' => 'My custom post type', 
    'post_name' => 'custom-post-title', 
    'post_type' => 'my-cpt' ,
) );

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

PS. There's no develop branch in this project. This is why I'm aiming for master.

tlovett1 commented 4 years ago

Awesome. Thank you!