Fixed unit tests

This commit is contained in:
Claudio Sanches 2021-03-12 17:25:15 -03:00 committed by Nestor Soriano
parent e2e914ed39
commit a761e78a84
No known key found for this signature in database
GPG Key ID: 08110F3518C12CAD
2 changed files with 1 additions and 19 deletions

View File

@ -28,7 +28,7 @@ class WC_Discounts_Tests extends WC_Unit_Test_Case {
* Helper method to create customer.
*/
public function create_customer() {
$username = 'testusername-' . microtime( true ) . wp_generate_password( 6, false, false );
$username = sanitize_title( 'testusername-' . microtime( true ) . wp_generate_password( 6, false, false ) );
$customer = new WC_Customer();
$customer->set_username( $username );
$customer->set_password( 'test123' );

View File

@ -29,7 +29,6 @@ class WC_Settings_Advanced_Test extends WC_Settings_Unit_Test_Case {
'webhooks',
'legacy_api',
'woocommerce_com',
'features',
);
$this->assertEquals( $expected, $section_names );
@ -184,23 +183,6 @@ class WC_Settings_Advanced_Test extends WC_Settings_Unit_Test_Case {
$this->assertEquals( $expected, $settings_ids_and_types );
}
/**
* @testdox get_settings('features') should return all the settings for the features section.
*/
public function test_get_features_settings_returns_all_settings() {
$sut = new WC_Settings_Advanced();
$expected = array(
'legacy_api_options' => array( 'title', 'sectionend' ),
'woocommerce_api_enabled' => 'checkbox',
);
$settings = $sut->get_settings( 'legacy_api' );
$settings_ids_and_types = $this->get_ids_and_types( $settings );
$this->assertEquals( $expected, $settings_ids_and_types );
}
/**
* @testdox output method should invoke the output method of the appropriate class depending on the section.
*