function test_the_correct_taxes_are_set() { global $woocommerce; TaxJar_Woocommerce_helper::prepare_woocommerce(); $tj = new WC_Taxjar_Integration(); $woocommerce->shipping->shipping_total = 5; do_action('woocommerce_calculate_totals', $woocommerce->cart); $this->assertEquals($woocommerce->cart->tax_total, 0.73, '', 0.001); $this->assertEquals(array_values($woocommerce->cart->shipping_taxes)[0], 0.36, '', 0.001); $this->assertEquals($woocommerce->cart->get_taxes_total(), 1.09, '', 0.001); }
function test_append_base_address_to_customer_taxable_address() { global $woocommerce; TaxJar_Woocommerce_helper::prepare_woocommerce(); $tj = new WC_Taxjar_Integration(); $woocommerce->session->set('chosen_shipping_methods', array('local_pickup')); $address = array('US', 'CO', '81210', 'Denver'); $address = apply_filters('woocommerce_customer_taxable_address', $address); $this->assertEquals(strtoupper($address[2]), strtoupper($tj->settings['store_zip'])); $this->assertEquals(strtoupper($address[3]), strtoupper($tj->settings['store_city'])); }