Opened 7 years ago
Closed 7 years ago
#47439 closed defect (bug) (fixed)
wp-phpunit: go_to() does not unset current_screen
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 5.3 | Priority: | normal |
| Severity: | normal | Version: | 5.3 |
| Component: | Build/Test Tools | Keywords: | has-patch |
| Focuses: | Cc: |
Description
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
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
In 45486: