Skip to content

Commit 9868144

Browse files
committed
(general cleanup) converted spacing to tabs, removed extra spaces and tabs at file ends
1 parent 567d755 commit 9868144

File tree

358 files changed

+38318
-38318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

358 files changed

+38318
-38318
lines changed

tests/test-wpsc-country.class.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
class TestWPSCCountryClass extends WP_UnitTestCase {
44

55
// The main country used for tests, has no regions.
6-
const COUNTRY_ID_WITHOUT_REGIONS = 223;
7-
const COUNTRY_ISOCODE_WITHOUT_REGIONS = 'GB';
8-
const COUNTRY_NAME_WITHOUT_REGIONS = 'United Kingdom';
9-
const COUNTRY_NAME_WITHOUT_REGIONS_CURRENCY_CODE = 'GBP';
10-
const COUNTRY_NAME_WITHOUT_REGIONS_CURRENCY_NAME = 'Pound Sterling';
11-
const COUNTRY_NAME_WITHOUT_REGIONS_CURRENCY_SYMBOL = '£';
6+
const COUNTRY_ID_WITHOUT_REGIONS = 223;
7+
const COUNTRY_ISOCODE_WITHOUT_REGIONS = 'GB';
8+
const COUNTRY_NAME_WITHOUT_REGIONS = 'United Kingdom';
9+
const COUNTRY_NAME_WITHOUT_REGIONS_CURRENCY_CODE = 'GBP';
10+
const COUNTRY_NAME_WITHOUT_REGIONS_CURRENCY_NAME = 'Pound Sterling';
11+
const COUNTRY_NAME_WITHOUT_REGIONS_CURRENCY_SYMBOL = '£';
1212
const COUNTRY_NAME_WITHOUT_REGIONS_CURRENCY_SYMBOL_HTML = '£';
13-
const COUNTRY_WITHOUT_REGIONS_TAX_RATE = 17.5;
14-
const COUNTRY_WITHOUT_REGIONS_CONTINENT = 'europe';
13+
const COUNTRY_WITHOUT_REGIONS_TAX_RATE = 17.5;
14+
const COUNTRY_WITHOUT_REGIONS_CONTINENT = 'europe';
1515

1616
// A country with regions used for tests that need a region.
1717
const COUNTRY_ID_WITH_REGIONS = 136;
18-
const REGION_ID = 50;
19-
const NUM_REGIONS = 51;
20-
const REGION_CODE = 'OR';
21-
const REGION_NAME = 'Oregon';
22-
const INVALID_REGION_NAME = 'Oregano';
18+
const REGION_ID = 50;
19+
const NUM_REGIONS = 51;
20+
const REGION_CODE = 'OR';
21+
const REGION_NAME = 'Oregon';
22+
const INVALID_REGION_NAME = 'Oregano';
2323

2424
function setUp() {
2525
wpsc_create_or_update_tables();
@@ -70,48 +70,48 @@ function test_get_currency() {
7070
}
7171

7272
function test_get_currency_name() {
73-
$country = new WPSC_Country( self::COUNTRY_ID_WITHOUT_REGIONS );
73+
$country = new WPSC_Country( self::COUNTRY_ID_WITHOUT_REGIONS );
7474
$currency_name = $country->get_currency_name();
7575
$this->assertEquals( self::COUNTRY_NAME_WITHOUT_REGIONS_CURRENCY_NAME, $currency_name );
7676
}
7777

7878
function test_get_currency_symbol() {
79-
$country = new WPSC_Country( self::COUNTRY_ID_WITHOUT_REGIONS );
79+
$country = new WPSC_Country( self::COUNTRY_ID_WITHOUT_REGIONS );
8080
$currency_symbol = $country->get_currency_symbol();
8181
$this->assertEquals( self::COUNTRY_NAME_WITHOUT_REGIONS_CURRENCY_SYMBOL, $currency_symbol );
8282
}
8383

8484
function test_get_currency_symbol_html() {
85-
$country = new WPSC_Country( self::COUNTRY_ID_WITHOUT_REGIONS );
85+
$country = new WPSC_Country( self::COUNTRY_ID_WITHOUT_REGIONS );
8686
$currency_symbol = $country->get_currency_symbol_html();
8787
$this->assertEquals( self::COUNTRY_NAME_WITHOUT_REGIONS_CURRENCY_SYMBOL_HTML, $currency_symbol );
8888
}
8989

9090
function test_get_currency_code() {
91-
$country = new WPSC_Country( self::COUNTRY_ID_WITHOUT_REGIONS );
91+
$country = new WPSC_Country( self::COUNTRY_ID_WITHOUT_REGIONS );
9292
$currency_code = $country->get_currency_code();
9393
$this->assertEquals( self::COUNTRY_NAME_WITHOUT_REGIONS_CURRENCY_CODE, $currency_code );
9494
}
9595

9696
function test_has_regions() {
97-
$country = new WPSC_Country( self::COUNTRY_ID_WITHOUT_REGIONS );
97+
$country = new WPSC_Country( self::COUNTRY_ID_WITHOUT_REGIONS );
9898
$has_regions = $country->has_regions();
9999
$this->assertFalse( $has_regions );
100-
$country = new WPSC_Country( self::COUNTRY_ID_WITH_REGIONS ); // USA
100+
$country = new WPSC_Country( self::COUNTRY_ID_WITH_REGIONS ); // USA
101101
$has_regions = $country->has_regions();
102102
$this->assertTrue( $has_regions );
103103
}
104104

105105
function test_has_region() {
106106
// UK
107-
$country = new WPSC_Country( self::COUNTRY_ID_WITHOUT_REGIONS );
107+
$country = new WPSC_Country( self::COUNTRY_ID_WITHOUT_REGIONS );
108108
$has_region = $country->has_region( self::REGION_ID );
109109
$this->assertFalse( $has_region ); // Oregon is not in the UK
110110
$has_region = $country->has_region( -1 );
111111
$this->assertFalse( $has_region ); // Non-existent region is not in the UK
112112

113113
// USA
114-
$country = new WPSC_Country( self::COUNTRY_ID_WITH_REGIONS );
114+
$country = new WPSC_Country( self::COUNTRY_ID_WITH_REGIONS );
115115
$has_region = $country->has_region( self::REGION_ID );
116116
$this->assertTrue( $has_region ); // Oregon is in the USA
117117
$has_region = $country->has_region( self::REGION_NAME );
@@ -124,7 +124,7 @@ function test_has_region() {
124124

125125
function test_get_tax() {
126126
$country = new WPSC_Country( self::COUNTRY_ID_WITHOUT_REGIONS );
127-
$tax = $country->get_tax();
127+
$tax = $country->get_tax();
128128
$this->assertEquals( self::COUNTRY_WITHOUT_REGIONS_TAX_RATE, $tax );
129129
}
130130

tests/test-wpsc-coupon.class.php

Lines changed: 84 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ class TestWPSCCouponClass extends WP_UnitTestCase {
55
const START_DATE = '2015-03-06';
66
const EXPIRY_DATE = '2015-04-16';
77

8-
const PERCENTAGE_COUPON_ID = 1;
9-
const PERCENTAGE_COUPON_CODE = 'TEST_PERCENTAGE';
10-
const FIXED_COUPON_ID = 2;
11-
const FIXED_COUPON_CODE = 'TEST_FIXED';
8+
const PERCENTAGE_COUPON_ID = 1;
9+
const PERCENTAGE_COUPON_CODE = 'TEST_PERCENTAGE';
10+
const FIXED_COUPON_ID = 2;
11+
const FIXED_COUPON_CODE = 'TEST_FIXED';
1212
const FREE_SHIPPING_COUPON_ID = 3;
1313
const FREE_SHIPPING_COUPON_CODE = 'TEST_FREE_SHIPPING';
14-
const USE_ONCE_COUPON_ID = 4;
15-
const USE_ONCE_COUPON_CODE = 'TEST_USE_ONCE';
16-
const EXPIRY_COUPON_ID = 5;
17-
const EXPIRY_COUPON_CODE = 'TEST_EXPIRY';
18-
const DELETE_COUPON_ID = 6;
19-
const DELETE_COUPON_CODE = 'TEST_DELETE';
20-
const CONDITIONS_COUPON_ID = 7;
21-
const CONDITIONS_COUPON_CODE = 'TEST_CONDITIONS';
22-
const ACTIVE_COUPON_ID = 8;
23-
const ACTIVE_COUPON_CODE = 'TEST_ACTIVE';
14+
const USE_ONCE_COUPON_ID = 4;
15+
const USE_ONCE_COUPON_CODE = 'TEST_USE_ONCE';
16+
const EXPIRY_COUPON_ID = 5;
17+
const EXPIRY_COUPON_CODE = 'TEST_EXPIRY';
18+
const DELETE_COUPON_ID = 6;
19+
const DELETE_COUPON_CODE = 'TEST_DELETE';
20+
const CONDITIONS_COUPON_ID = 7;
21+
const CONDITIONS_COUPON_CODE = 'TEST_CONDITIONS';
22+
const ACTIVE_COUPON_ID = 8;
23+
const ACTIVE_COUPON_CODE = 'TEST_ACTIVE';
2424

2525
function setUp() {
2626
wpsc_create_or_update_tables();
@@ -39,115 +39,115 @@ function setup_test_data() {
3939
$truncate = $wpdb->query( "TRUNCATE TABLE `" . WPSC_TABLE_COUPON_CODES . "`" );
4040

4141
$wpdb->insert( WPSC_TABLE_COUPON_CODES, array(
42-
'id' => self::PERCENTAGE_COUPON_ID,
42+
'id' => self::PERCENTAGE_COUPON_ID,
4343
'coupon_code' => self::PERCENTAGE_COUPON_CODE,
44-
'value' => '50',
44+
'value' => '50',
4545
'is-percentage' => 1,
46-
'use-once' => 0,
47-
'is-used' => 0,
48-
'active' => 1,
46+
'use-once' => 0,
47+
'is-used' => 0,
48+
'active' => 1,
4949
'every_product' => 0,
50-
'start' => '0000-00-00',
51-
'expiry' => '0000-00-00',
52-
'condition' => serialize( array() )
50+
'start' => '0000-00-00',
51+
'expiry' => '0000-00-00',
52+
'condition' => serialize( array() )
5353
), array( '%d', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%s', '%s' ) );
5454

5555
$wpdb->insert( WPSC_TABLE_COUPON_CODES, array(
56-
'id' => self::FIXED_COUPON_ID,
56+
'id' => self::FIXED_COUPON_ID,
5757
'coupon_code' => self::FIXED_COUPON_CODE,
58-
'value' => '5',
58+
'value' => '5',
5959
'is-percentage' => 0,
60-
'use-once' => 0,
61-
'is-used' => 0,
62-
'active' => 1,
60+
'use-once' => 0,
61+
'is-used' => 0,
62+
'active' => 1,
6363
'every_product' => 0,
64-
'start' => '0000-00-00',
65-
'expiry' => '0000-00-00',
66-
'condition' => serialize( array() )
64+
'start' => '0000-00-00',
65+
'expiry' => '0000-00-00',
66+
'condition' => serialize( array() )
6767
), array( '%d', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%s', '%s' ) );
6868

6969
$wpdb->insert( WPSC_TABLE_COUPON_CODES, array(
70-
'id' => self::FREE_SHIPPING_COUPON_ID,
70+
'id' => self::FREE_SHIPPING_COUPON_ID,
7171
'coupon_code' => self::FREE_SHIPPING_COUPON_CODE,
72-
'value' => '5',
72+
'value' => '5',
7373
'is-percentage' => 2,
74-
'use-once' => 0,
75-
'is-used' => 0,
76-
'active' => 1,
74+
'use-once' => 0,
75+
'is-used' => 0,
76+
'active' => 1,
7777
'every_product' => 0,
78-
'start' => '0000-00-00',
79-
'expiry' => '0000-00-00',
80-
'condition' => serialize( array() )
78+
'start' => '0000-00-00',
79+
'expiry' => '0000-00-00',
80+
'condition' => serialize( array() )
8181
), array( '%d', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%s', '%s' ) );
8282

8383
$wpdb->insert( WPSC_TABLE_COUPON_CODES, array(
84-
'id' => self::USE_ONCE_COUPON_ID,
84+
'id' => self::USE_ONCE_COUPON_ID,
8585
'coupon_code' => self::USE_ONCE_COUPON_CODE,
86-
'value' => '10',
86+
'value' => '10',
8787
'is-percentage' => 0,
88-
'use-once' => 1,
89-
'is-used' => 0,
90-
'active' => 1,
88+
'use-once' => 1,
89+
'is-used' => 0,
90+
'active' => 1,
9191
'every_product' => 0,
92-
'start' => '0000-00-00',
93-
'expiry' => '0000-00-00',
94-
'condition' => serialize( array() )
92+
'start' => '0000-00-00',
93+
'expiry' => '0000-00-00',
94+
'condition' => serialize( array() )
9595
), array( '%d', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%s', '%s' ) );
9696

9797
$wpdb->insert( WPSC_TABLE_COUPON_CODES, array(
98-
'id' => self::EXPIRY_COUPON_ID,
98+
'id' => self::EXPIRY_COUPON_ID,
9999
'coupon_code' => self::EXPIRY_COUPON_CODE,
100-
'value' => '10',
100+
'value' => '10',
101101
'is-percentage' => 0,
102-
'use-once' => 1,
103-
'is-used' => 0,
104-
'active' => 1,
102+
'use-once' => 1,
103+
'is-used' => 0,
104+
'active' => 1,
105105
'every_product' => 0,
106-
'start' => self::START_DATE,
107-
'expiry' => self::EXPIRY_DATE,
108-
'condition' => serialize( array() )
106+
'start' => self::START_DATE,
107+
'expiry' => self::EXPIRY_DATE,
108+
'condition' => serialize( array() )
109109
), array( '%d', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%s', '%s' ) );
110110

111111
$wpdb->insert( WPSC_TABLE_COUPON_CODES, array(
112-
'id' => self::DELETE_COUPON_ID,
112+
'id' => self::DELETE_COUPON_ID,
113113
'coupon_code' => self::DELETE_COUPON_CODE,
114-
'value' => '10',
114+
'value' => '10',
115115
'is-percentage' => 0,
116-
'use-once' => 0,
117-
'is-used' => 0,
118-
'active' => 0,
116+
'use-once' => 0,
117+
'is-used' => 0,
118+
'active' => 0,
119119
'every_product' => 0,
120-
'start' => self::START_DATE,
121-
'expiry' => self::EXPIRY_DATE,
122-
'condition' => serialize( array() )
120+
'start' => self::START_DATE,
121+
'expiry' => self::EXPIRY_DATE,
122+
'condition' => serialize( array() )
123123
), array( '%d', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%s', '%s' ) );
124124

125125
$wpdb->insert( WPSC_TABLE_COUPON_CODES, array(
126-
'id' => self::CONDITIONS_COUPON_ID,
126+
'id' => self::CONDITIONS_COUPON_ID,
127127
'coupon_code' => self::CONDITIONS_COUPON_CODE,
128-
'value' => '10',
128+
'value' => '10',
129129
'is-percentage' => 0,
130-
'use-once' => 0,
131-
'is-used' => 0,
132-
'active' => 0,
130+
'use-once' => 0,
131+
'is-used' => 0,
132+
'active' => 0,
133133
'every_product' => 0,
134-
'start' => '0000-00-00',
135-
'expiry' => '0000-00-00',
136-
'condition' => serialize( $this->get_test_conditions() )
134+
'start' => '0000-00-00',
135+
'expiry' => '0000-00-00',
136+
'condition' => serialize( $this->get_test_conditions() )
137137
), array( '%d', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%s', '%s' ) );
138138

139139
$wpdb->insert( WPSC_TABLE_COUPON_CODES, array(
140-
'id' => self::ACTIVE_COUPON_ID,
140+
'id' => self::ACTIVE_COUPON_ID,
141141
'coupon_code' => self::ACTIVE_COUPON_CODE,
142-
'value' => '10',
142+
'value' => '10',
143143
'is-percentage' => 0,
144-
'use-once' => 0,
145-
'is-used' => 0,
146-
'active' => 1,
144+
'use-once' => 0,
145+
'is-used' => 0,
146+
'active' => 1,
147147
'every_product' => 0,
148-
'start' => '0000-00-00',
149-
'expiry' => '0000-00-00',
150-
'condition' => serialize( array() )
148+
'start' => '0000-00-00',
149+
'expiry' => '0000-00-00',
150+
'condition' => serialize( array() )
151151
), array( '%d', '%s', '%s', '%d', '%d', '%d', '%d', '%d', '%s', '%s', '%s' ) );
152152

153153
}
@@ -159,15 +159,15 @@ function get_test_conditions() {
159159
array(
160160
'operator' => '',
161161
'property' => 'item_name',
162-
'logic' => 'equal',
163-
'value' => 'Test Product'
162+
'logic' => 'equal',
163+
'value' => 'Test Product'
164164
),
165165

166166
array(
167167
'operator' => 'and',
168168
'property' => 'item_quantity',
169-
'logic' => 'greater',
170-
'value' => '1'
169+
'logic' => 'greater',
170+
'value' => '1'
171171
)
172172

173173
);
@@ -203,9 +203,9 @@ function test_insert_coupon() {
203203

204204
$coupon = new WPSC_Coupon( array(
205205
'coupon_code' => self::PERCENTAGE_COUPON_CODE,
206-
'value' => '50',
206+
'value' => '50',
207207
'is-percentage' => '1',
208-
'active' => '1'
208+
'active' => '1'
209209
) );
210210

211211
$result = $coupon->save();

tests/test-wpsc-region.class.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
class TestWPSCRegionClass extends WP_UnitTestCase {
44

55
// Test country / regions
6-
const COUNTRY_ID_WITH_REGIONS = 136;
6+
const COUNTRY_ID_WITH_REGIONS = 136;
77
const COUNTRY_ISOCODE_WITH_REGIONS = 'US';
8-
const REGION_ID = 50;
9-
const REGION_CODE = 'OR';
10-
const REGION_NAME = 'Oregon';
11-
const INVALID_REGION_NAME = 'Oregano';
12-
const REGION_TAX_RATE = 0.0;
8+
const REGION_ID = 50;
9+
const REGION_CODE = 'OR';
10+
const REGION_NAME = 'Oregon';
11+
const INVALID_REGION_NAME = 'Oregano';
12+
const REGION_TAX_RATE = 0.0;
1313

1414
function setUp() {
1515
wpsc_create_or_update_tables();

0 commit comments

Comments
 (0)