/** * Test setting meta. * @since 2.7.0 */ public function test_set_meta() { $customer = WC_Helper_Customer::create_customer(); $customer_id = $customer->get_id(); $meta_value = time() . '-custom-value'; $customer->add_meta_data('my-field', $meta_value, true); $customer->save(); $customer = new WC_Customer($customer_id); $this->assertEquals($meta_value, $customer->get_meta('my-field')); }