Unit test warnings

This commit is contained in:
Mike Jolley 2017-01-03 12:19:03 +00:00
parent 5ec8ef50e6
commit 98b79ddf5b
3 changed files with 6 additions and 3 deletions

View File

@ -30,7 +30,8 @@ class WC_API_Unit_Test_Case extends WC_Unit_Test_Case {
$_SERVER['REQUEST_METHOD'] = null;
// mock the API server to prevent headers from being sent
$this->mock_server = $this->getMock( 'WC_API_Server', array( 'header' ), array( '/' ) );
// $this->mock_server = $this->getMock( 'WC_API_Server', array( 'header' ), array( '/' ) );
$this->mock_server = $this->getMockBuilder( 'WC_API_Server' )->setMethods( array( 'header' ) )->disableOriginalConstructor()->getMock();
WC()->api->register_resources( $this->mock_server );
}

View File

@ -373,7 +373,8 @@ class Settings extends WC_REST_Unit_Test_Case {
* @since 2.7.0
*/
public function test_get_setting_invalid_setting_type() {
$controller = $this->getMock( 'WC_Rest_Settings_Options_Controller', array( 'get_group_settings', 'is_setting_type_valid' ) );
// $controller = $this->getMock( 'WC_Rest_Settings_Options_Controller', array( 'get_group_settings', 'is_setting_type_valid' ) );
$controller = $this->getMockBuilder( 'WC_Rest_Settings_Options_Controller' )->setMethods( array( 'get_group_settings', 'is_setting_type_valid' ) )->getMock();
$controller
->expects( $this->any() )

View File

@ -21,7 +21,8 @@ class WC_Tests_Register_WP_Admin_Settings extends WC_Unit_Test_Case {
public function setUp() {
parent::setUp();
$mock_page = $this->getMock( 'WC_Settings_General' );
// $mock_page = $this->getMock( 'WC_Settings_General' );
$mock_page = $this->getMockBuilder( 'WC_Settings_General' )->getMock();
$mock_page
->expects( $this->any() )