*WHITESPACE ONLY* Equal sign and arrow alignment
This commit is contained in:
parent
2ffb8c8481
commit
7cb8f46b0a
|
@ -24,8 +24,8 @@ class WC_Tests_Coupon extends WC_Unit_Test_Case {
|
|||
$coupon_2->set_code( (string) $coupon_1->get_id() );
|
||||
$coupon_2->save();
|
||||
|
||||
$int_id_1 = $coupon_1->get_id();
|
||||
$int_id_2 = $coupon_2->get_id();
|
||||
$int_id_1 = $coupon_1->get_id();
|
||||
$int_id_2 = $coupon_2->get_id();
|
||||
$string_code_2 = $coupon_2->get_code();
|
||||
|
||||
// Test getting a coupon by integer ID.
|
||||
|
|
|
@ -21,7 +21,7 @@ class WC_Tests_Coupon_Data_Store extends WC_Unit_Test_Case {
|
|||
* @since 3.0.0
|
||||
*/
|
||||
function test_coupon_create() {
|
||||
$code = 'coupon-' . time();
|
||||
$code = 'coupon-' . time();
|
||||
$coupon = new WC_Coupon;
|
||||
$coupon->set_code( $code );
|
||||
$coupon->set_description( 'This is a test comment.' );
|
||||
|
@ -36,7 +36,7 @@ class WC_Tests_Coupon_Data_Store extends WC_Unit_Test_Case {
|
|||
* @since 3.0.0
|
||||
*/
|
||||
function test_coupon_delete() {
|
||||
$coupon = WC_Helper_Coupon::create_coupon();
|
||||
$coupon = WC_Helper_Coupon::create_coupon();
|
||||
$coupon_id = $coupon->get_id();
|
||||
$this->assertNotEquals( 0, $coupon_id );
|
||||
$coupon->delete( true );
|
||||
|
@ -52,7 +52,7 @@ class WC_Tests_Coupon_Data_Store extends WC_Unit_Test_Case {
|
|||
$coupon->delete( true );
|
||||
|
||||
$cache_name = WC_Cache_Helper::get_cache_prefix( 'coupons' ) . 'coupon_id_from_code_' . $coupon->get_code();
|
||||
$ids = wp_cache_get( $cache_name, 'coupons' );
|
||||
$ids = wp_cache_get( $cache_name, 'coupons' );
|
||||
|
||||
$this->assertEquals( false, $ids, sprintf( 'Object cache for %s was not removed upon deletion of coupon.', $cache_name ) );
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ class WC_Tests_Coupon_Data_Store extends WC_Unit_Test_Case {
|
|||
* @since 3.0.0
|
||||
*/
|
||||
function test_coupon_update() {
|
||||
$coupon = WC_Helper_Coupon::create_coupon();
|
||||
$coupon = WC_Helper_Coupon::create_coupon();
|
||||
$coupon_id = $coupon->get_id();
|
||||
$this->assertEquals( 'dummycoupon', $coupon->get_code() );
|
||||
$coupon->set_code( 'dummycoupon2' );
|
||||
|
@ -76,7 +76,7 @@ class WC_Tests_Coupon_Data_Store extends WC_Unit_Test_Case {
|
|||
* @since 3.0.0
|
||||
*/
|
||||
function test_coupon_read() {
|
||||
$code = 'coupon-' . time();
|
||||
$code = 'coupon-' . time();
|
||||
$coupon = new WC_Coupon;
|
||||
$coupon->set_code( $code );
|
||||
$coupon->set_description( 'This is a test coupon.' );
|
||||
|
@ -96,7 +96,7 @@ class WC_Tests_Coupon_Data_Store extends WC_Unit_Test_Case {
|
|||
* @since 3.0.0
|
||||
*/
|
||||
function test_coupon_save() {
|
||||
$coupon = WC_Helper_Coupon::create_coupon();
|
||||
$coupon = WC_Helper_Coupon::create_coupon();
|
||||
$coupon_id = $coupon->get_id();
|
||||
$coupon->set_code( 'dummycoupon2' );
|
||||
$coupon->save();
|
||||
|
|
|
@ -32,7 +32,7 @@ class WC_Tests_Coupon_Data extends WC_Unit_Test_Case {
|
|||
public function test_coupon_backwards_compat_props_use_correct_getters() {
|
||||
// Accessing properties directly will throw some wanted deprected notices
|
||||
// So we need to let PHPUnit know we are expecting them and it's fine to continue
|
||||
$legacy_keys = array(
|
||||
$legacy_keys = array(
|
||||
'id',
|
||||
'exists',
|
||||
'coupon_custom_fields',
|
||||
|
@ -92,7 +92,7 @@ class WC_Tests_Coupon_Data extends WC_Unit_Test_Case {
|
|||
* @since 3.0.0
|
||||
*/
|
||||
public function test_read_manual_coupon() {
|
||||
$code = 'manual_coupon_' . time();
|
||||
$code = 'manual_coupon_' . time();
|
||||
$coupon = new WC_Coupon( $code );
|
||||
$coupon->read_manual_coupon( $code, array(
|
||||
'id' => true,
|
||||
|
@ -122,10 +122,16 @@ class WC_Tests_Coupon_Data extends WC_Unit_Test_Case {
|
|||
* setting these values this way will also throw a deprecated notice so we will let
|
||||
* PHPUnit know that its okay to continue.
|
||||
*/
|
||||
$legacy_keys = array( 'product_ids', 'exclude_product_ids', 'individual_use', 'free_shipping', 'exclude_sale_items' );
|
||||
$legacy_keys = array(
|
||||
'product_ids',
|
||||
'exclude_product_ids',
|
||||
'individual_use',
|
||||
'free_shipping',
|
||||
'exclude_sale_items',
|
||||
);
|
||||
$this->expected_doing_it_wrong = array_merge( $this->expected_doing_it_wrong, $legacy_keys );
|
||||
$code = 'bc_manual_coupon_' . time();
|
||||
$coupon = new WC_Coupon( $code );
|
||||
$code = 'bc_manual_coupon_' . time();
|
||||
$coupon = new WC_Coupon( $code );
|
||||
$coupon->read_manual_coupon( $code, array(
|
||||
'id' => true,
|
||||
'type' => 'fixed_cart',
|
||||
|
@ -159,25 +165,25 @@ class WC_Tests_Coupon_Data extends WC_Unit_Test_Case {
|
|||
public function test_coupon_getters_and_setters() {
|
||||
$time = time();
|
||||
$standard_getters_and_setters = array(
|
||||
'code' => 'test',
|
||||
'description' => 'hello world',
|
||||
'discount_type' => 'percent',
|
||||
'amount' => 10.50,
|
||||
'usage_count' => 5,
|
||||
'individual_use' => true,
|
||||
'product_ids' => array( 5, 10 ),
|
||||
'exclude_product_ids' => array( 2, 1 ),
|
||||
'usage_limit' => 2,
|
||||
'usage_limit_per_user' => 10,
|
||||
'limit_usage_to_x_items' => 2,
|
||||
'free_shipping' => true,
|
||||
'product_categories' => array( 6 ),
|
||||
'code' => 'test',
|
||||
'description' => 'hello world',
|
||||
'discount_type' => 'percent',
|
||||
'amount' => 10.50,
|
||||
'usage_count' => 5,
|
||||
'individual_use' => true,
|
||||
'product_ids' => array( 5, 10 ),
|
||||
'exclude_product_ids' => array( 2, 1 ),
|
||||
'usage_limit' => 2,
|
||||
'usage_limit_per_user' => 10,
|
||||
'limit_usage_to_x_items' => 2,
|
||||
'free_shipping' => true,
|
||||
'product_categories' => array( 6 ),
|
||||
'exclude_product_categories' => array( 8 ),
|
||||
'exclude_sale_items' => true,
|
||||
'minimum_amount' => 2,
|
||||
'maximum_amount' => 1000,
|
||||
'customer_email' => array( 'test@woo.local' ),
|
||||
'used_by' => array( 1 ),
|
||||
'exclude_sale_items' => true,
|
||||
'minimum_amount' => 2,
|
||||
'maximum_amount' => 1000,
|
||||
'customer_email' => array( 'test@woo.local' ),
|
||||
'used_by' => array( 1 ),
|
||||
);
|
||||
|
||||
$coupon = new WC_Coupon;
|
||||
|
@ -199,7 +205,7 @@ class WC_Tests_Coupon_Data extends WC_Unit_Test_Case {
|
|||
$coupon->add_meta_data( 'test_coupon_field', $meta_value, true );
|
||||
$coupon->save_meta_data();
|
||||
|
||||
$coupon = new WC_Coupon( $coupon_id );
|
||||
$coupon = new WC_Coupon( $coupon_id );
|
||||
$custom_fields = $coupon->get_meta_data();
|
||||
$this->assertCount( 1, $custom_fields );
|
||||
$this->assertEquals( $meta_value, $coupon->get_meta( 'test_coupon_field' ) );
|
||||
|
|
Loading…
Reference in New Issue