wp-phpunit / issues

Central issues repository for wp-phpunit
0 stars 0 forks source link

go_to() does not unset current_screen #5

Closed mauteri closed 5 years ago

mauteri commented 5 years ago

current_screen should be added to this array for unsetting: https://github.com/wp-phpunit/wp-phpunit/blob/master/includes/abstract-testcase.php#L710

As of now, if you set_current_screen (which is automatically done in WP_Ajax_UnitTestCase to set_current_screen( ‘ajax’ )) is_admin() will be true when you tell your test, for example, $this->go_to( '/' ); A test like this will fail:

$this->go_to( '/' ); // go to homepage
$this->assertFalse( is_admin() ); // fails because is_admin() is true
aaemnnosttv commented 5 years ago

You'll need to open this as a ticket with WordPress core as this project is just a mirror of a subset of WordPress core, not a standalone package.

mauteri commented 5 years ago

Cool, that's fine. The readme says to direct issues here, so might want to update that.

This repository is built from the official WordPress git mirror git://develop.git.wordpress.org. Please direct all issues here.
aaemnnosttv commented 5 years ago

I agree, the problem is that would only change new versions of the package. I think an issue template may be in order. Thanks for the suggestion!

mauteri commented 5 years ago

I hear ya. Maybe leave one open issue with the title to not put issues here :-D

aaemnnosttv commented 5 years ago

That's a bit too broad I think, but it should be more clear that this is a place for issues specifically related to the wp-phpunit package, build, installation, etc and not the upstream implementation 👍