Add new setting to tests
This commit is contained in:
parent
391af06505
commit
a8bce95716
|
@ -22,7 +22,7 @@ class WC_Settings_Accounts_Test extends WC_Settings_Unit_Test_Case {
|
||||||
|
|
||||||
add_filter(
|
add_filter(
|
||||||
'woocommerce_account_settings',
|
'woocommerce_account_settings',
|
||||||
function( $settings ) use ( &$actual_settings_via_filter ) {
|
function ( $settings ) use ( &$actual_settings_via_filter ) {
|
||||||
$actual_settings_via_filter = $settings;
|
$actual_settings_via_filter = $settings;
|
||||||
return $settings;
|
return $settings;
|
||||||
},
|
},
|
||||||
|
@ -67,6 +67,7 @@ class WC_Settings_Accounts_Test extends WC_Settings_Unit_Test_Case {
|
||||||
'woocommerce_trash_failed_orders' => 'relative_date_selector',
|
'woocommerce_trash_failed_orders' => 'relative_date_selector',
|
||||||
'woocommerce_trash_cancelled_orders' => 'relative_date_selector',
|
'woocommerce_trash_cancelled_orders' => 'relative_date_selector',
|
||||||
'woocommerce_anonymize_completed_orders' => 'relative_date_selector',
|
'woocommerce_anonymize_completed_orders' => 'relative_date_selector',
|
||||||
|
'woocommerce_enable_delayed_account_creation' => 'checkbox',
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertEquals( $expected, $settings_ids_and_types );
|
$this->assertEquals( $expected, $settings_ids_and_types );
|
||||||
|
@ -113,12 +114,12 @@ class WC_Settings_Accounts_Test extends WC_Settings_Unit_Test_Case {
|
||||||
public function test_linked_text_for_erasure_request_settings( $current_user_can_manage_privacy_options, $blog_version, $expected_order_erasure_text, $expected_downloads_erasure_text ) {
|
public function test_linked_text_for_erasure_request_settings( $current_user_can_manage_privacy_options, $blog_version, $expected_order_erasure_text, $expected_downloads_erasure_text ) {
|
||||||
FunctionsMockerHack::add_function_mocks(
|
FunctionsMockerHack::add_function_mocks(
|
||||||
array(
|
array(
|
||||||
'current_user_can' => function( $capability, ...$args ) use ( $current_user_can_manage_privacy_options ) {
|
'current_user_can' => function ( $capability, ...$args ) use ( $current_user_can_manage_privacy_options ) {
|
||||||
return 'manage_privacy_options' === $capability ?
|
return 'manage_privacy_options' === $capability ?
|
||||||
$current_user_can_manage_privacy_options :
|
$current_user_can_manage_privacy_options :
|
||||||
current_user_can( $capability, ...$args );
|
current_user_can( $capability, ...$args );
|
||||||
},
|
},
|
||||||
'get_bloginfo' => function( $show = '', $filter = 'raw' ) use ( $blog_version ) {
|
'get_bloginfo' => function ( $show = '', $filter = 'raw' ) use ( $blog_version ) {
|
||||||
return 'version' === $show ?
|
return 'version' === $show ?
|
||||||
$blog_version :
|
$blog_version :
|
||||||
get_bloginfo( $show, $filter );
|
get_bloginfo( $show, $filter );
|
||||||
|
|
Loading…
Reference in New Issue