Closed simonwheatley closed 9 years ago
Hmmm, the function being called is in trunk and intended to be in 4.4.0… but we're running these tests on other WordPress versions, hence the breakage.
/**
* Determines whether a post type is considered "viewable".
*
* For built-in post types such as posts and pages, the 'public' value will be evaluated.
* For all others, the 'publicly_queryable' value will be used.
*
* @since 4.4.0
*
* @param object $post_type_object Post type object.
* @return bool Whether the post type should be considered viewable.
*/
function is_post_type_viewable( $post_type_object ) {
return $post_type_object->publicly_queryable || ( $post_type_object->_builtin && $post_type_object->public );
}
Core ticket: https://core.trac.wordpress.org/ticket/33888
@simonwheatley I'm getting the same thing on a diff't project. For me it seems to be triggered by WP_UnitTestCase::go_to('/')
Hey guys, see here for the solution: https://wordpress.slack.com/archives/core/p1442426444002024
Basically, adding a shim like so will resolve the issue: https://github.com/easydigitaldownloads/Easy-Digital-Downloads/blob/master/tests/helpers/shims.php
@devinwalker Hah! Snap: https://github.com/Automattic/babble/blob/fix/330-richaber-adds-tests/tests/babble-compat.php
Thanks! :smiley:
Well looky there!
Fixed by #333
Running the PHPUnit tests currently results in a fatal error, due to
is_post_type_viewable()
being called at a point when it is not defined.Below is the output when I run PHPUnit.