Fixed unit tests
This commit is contained in:
parent
e2e914ed39
commit
a761e78a84
|
@ -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' );
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue