Disable leaderboard tests if admin is not installed

This commit is contained in:
Mike Jolley 2019-06-12 13:17:26 +01:00
parent e45cd8addf
commit 4a860656c5
1 changed files with 4 additions and 0 deletions

View File

@ -47,6 +47,10 @@ class Leaderboards extends WC_REST_Unit_Test_Case {
* Setup our test server, endpoints, and user info. * Setup our test server, endpoints, and user info.
*/ */
public function setUp() { public function setUp() {
if ( ! class_exists( '\WC_Admin_Reports_Sync' ) ) {
$this->markTestSkipped( 'Skipping reports tests - WC_Admin_Reports_Sync class not found.' );
return;
}
parent::setUp(); parent::setUp();
wp_set_current_user( self::$user ); wp_set_current_user( self::$user );
} }