Repository navigation
[Sidebars endpoint] Add permissions PHPUnit tests - #24784
Conversation
…th the sidebars endpoint
|
Size Change: +2.43 kB (0%) Total Size: 1.16 MB
ℹ️ View Unchanged
|
draganescu
left a comment
There was a problem hiding this comment.
Everything is green, let's make it more green.
TimothyBJacobs
left a comment
There was a problem hiding this comment.
Thanks for adding these! I left some feedback.
| */ | ||
|
|
||
| require_once dirname( __FILE__ ) . '/../lib/class-wp-rest-sidebars-controller.php'; | ||
| add_filter( |
There was a problem hiding this comment.
| add_filter( | |
| add_action( |
There was a problem hiding this comment.
Also, why do we need to include this here at all? If it is because the endpoint is in an experiment, I think we should do the same thing we did as the block directory and enable the experiment in the tests
tellyworth@26363cf#diff-85d18a6eb126c0f8c8da280e74555a2c
In phpunit/bootstrap.php.
$GLOBALS['wp_tests_options'] = array(
'gutenberg-experiments' => array(
'gutenberg-block-directory' => '1',
),
);| $this->assertArrayHasKey( 'widgets', $properties ); | ||
| } | ||
|
|
||
| public function users_without_permissions() { |
There was a problem hiding this comment.
Are you sure this is working as expected? As far as I know, data providers are executed before setup before class, which means that the ids haven't been created yet. This is probably why the tests are passing when checking for a 401.
Co-authored-by: Timothy Jacobs <timothy@ironbounddesigns.com>
Co-authored-by: Timothy Jacobs <timothy@ironbounddesigns.com>
Co-authored-by: Timothy Jacobs <timothy@ironbounddesigns.com>
Co-authored-by: Timothy Jacobs <timothy@ironbounddesigns.com>
Co-authored-by: Timothy Jacobs <timothy@ironbounddesigns.com>
…utenberg into update/phpunit-widget-screen
|
All good notes @TimothyBJacobs, I just addressed your comments, would you mind re-reviewing? |
Description
This PR adds coverage for when the user is logged out or has insufficient permissions as per #24290 (review).
How has this been tested?
Confirm all checks pass on this PR.
Types of changes
Non-breaking change
Checklist: