Add admin_install_timestamp in WC_Tracker (#50076)
* Add admin_install_timestamp in WC_Tracker * Lint * Tweak tests * Tweak tests * Lint
This commit is contained in:
parent
191c8edd18
commit
61d9b63f67
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: tweak
|
||||
|
||||
Add admin_install_timestamp in WC_Tracker
|
|
@ -965,6 +965,7 @@ class WC_Tracker {
|
|||
'hpos_transactions_enabled' => get_option( 'woocommerce_use_db_transactions_for_custom_orders_table_data_sync' ),
|
||||
'hpos_transactions_level' => get_option( 'woocommerce_db_transactions_isolation_level_for_custom_orders_table_data_sync' ),
|
||||
'show_marketplace_suggestions' => get_option( 'woocommerce_show_marketplace_suggestions' ),
|
||||
'admin_install_timestamp' => get_option( 'woocommerce_admin_install_timestamp' ),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -231,4 +231,16 @@ class WC_Tracker_Test extends \WC_Unit_Test_Case {
|
|||
$this->assertEquals( '12345', $tracking_data['store_id'] );
|
||||
delete_option( \WC_Install::STORE_ID_OPTION );
|
||||
}
|
||||
|
||||
/**
|
||||
* @testDox Test woocommerce_install_admin_timestamp is included in tracking data.
|
||||
*/
|
||||
public function test_get_tracking_data_admin_install_timestamp() {
|
||||
$time = time();
|
||||
update_option( 'woocommerce_admin_install_timestamp', $time );
|
||||
$tracking_data = WC_Tracker::get_tracking_data();
|
||||
$this->assertArrayHasKey( 'admin_install_timestamp', $tracking_data['settings'] );
|
||||
$this->assertEquals( $tracking_data['settings']['admin_install_timestamp'], $time );
|
||||
delete_option( 'woocommerce_admin_install_timestamp' );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue