Completed
Push — master ( dfa2fa...646fe1 )
by Jason
11s
created
code/extensions/CustomerExtension.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,10 +25,10 @@
 block discarded – undo
25 25
         $response = FoxyCart::putCustomer($this->owner);
26 26
 
27 27
         // Grab customer_id record from FoxyCart response, store in Member
28
-		if($response){
29
-        	$foxyResponse = new SimpleXMLElement($response);
30
-        	$this->owner->Customer_ID = (int) $foxyResponse->customer_id;
31
-		}
28
+        if($response){
29
+            $foxyResponse = new SimpleXMLElement($response);
30
+            $this->owner->Customer_ID = (int) $foxyResponse->customer_id;
31
+        }
32 32
     }
33 33
 
34 34
 }
35 35
\ No newline at end of file
Please login to merge, or discard this patch.
tests/StoreSettingsTest.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -2,30 +2,30 @@
 block discarded – undo
2 2
 
3 3
 class StoreSettingsTest extends FS_Test{
4 4
 
5
-	protected static $use_draft_site = true;
5
+    protected static $use_draft_site = true;
6 6
 
7
-	function setUp(){
8
-		parent::setUp();
7
+    function setUp(){
8
+        parent::setUp();
9 9
 
10
-		$siteConf = SiteConfig::current_site_config();
11
-		$siteConf->StoreName = 'foxystripe';
10
+        $siteConf = SiteConfig::current_site_config();
11
+        $siteConf->StoreName = 'foxystripe';
12 12
         $siteConf->requireDefaultRecords();
13
-		$siteConf->write();
14
-	}
13
+        $siteConf->write();
14
+    }
15 15
 
16
-	function testStoreKey(){
17
-		$pref = FoxyCart::getKeyPrefix();
18
-		$siteConf = SiteConfig::current_site_config();
16
+    function testStoreKey(){
17
+        $pref = FoxyCart::getKeyPrefix();
18
+        $siteConf = SiteConfig::current_site_config();
19 19
 
20
-		$this->assertTrue(ctype_alnum($siteConf->StoreKey));
20
+        $this->assertTrue(ctype_alnum($siteConf->StoreKey));
21 21
         $this->assertEquals(strlen($siteConf->StoreKey), 60);
22 22
         $this->assertEquals(substr($siteConf->StoreKey, 0, 6), $pref);
23
-	}
23
+    }
24 24
 
25
-	function testStoreName(){
26
-		$siteConf = SiteConfig::current_site_config();
25
+    function testStoreName(){
26
+        $siteConf = SiteConfig::current_site_config();
27 27
 
28 28
         $this->assertEquals($siteConf->StoreName, 'foxystripe');
29
-	}
29
+    }
30 30
 
31 31
 }
Please login to merge, or discard this patch.
tests/ProductPageTest.php 1 patch
Indentation   +126 added lines, -126 removed lines patch added patch discarded remove patch
@@ -2,194 +2,194 @@
 block discarded – undo
2 2
 
3 3
 class ProductPageTest extends FS_Test{
4 4
 
5
-	protected static $use_draft_site = true;
5
+    protected static $use_draft_site = true;
6 6
 
7
-	function setUp(){
8
-		parent::setUp();
7
+    function setUp(){
8
+        parent::setUp();
9 9
 
10
-		$groupForItem = OptionGroup::create();
11
-		$groupForItem->Title = 'Sample-Group';
12
-		$groupForItem->write();
10
+        $groupForItem = OptionGroup::create();
11
+        $groupForItem->Title = 'Sample-Group';
12
+        $groupForItem->write();
13 13
 
14
-		$productHolder = ProductHolder::create();
15
-		$productHolder->Title = 'Product Holder';
16
-		$productHolder->write();
17
-	}
14
+        $productHolder = ProductHolder::create();
15
+        $productHolder->Title = 'Product Holder';
16
+        $productHolder->write();
17
+    }
18 18
 
19
-	function testProductCreation(){
19
+    function testProductCreation(){
20 20
 
21
-		$this->logInWithPermission('Product_CANCRUD');
22
-		$default = $this->objFromFixture('ProductCategory', 'default');
23
-		$default->write();
24
-		$product1 = $this->objFromFixture('ProductPage', 'product1');
25
-		$product1->ParentID = ProductHolder::get()->first()->ID;
21
+        $this->logInWithPermission('Product_CANCRUD');
22
+        $default = $this->objFromFixture('ProductCategory', 'default');
23
+        $default->write();
24
+        $product1 = $this->objFromFixture('ProductPage', 'product1');
25
+        $product1->ParentID = ProductHolder::get()->first()->ID;
26 26
 
27
-		$product1->doPublish();
28
-		$this->assertTrue($product1->isPublished());
27
+        $product1->doPublish();
28
+        $this->assertTrue($product1->isPublished());
29 29
 
30
-	}
30
+    }
31 31
 
32
-	function testProductDeletion(){
32
+    function testProductDeletion(){
33 33
 
34
-		$this->logInWithPermission('Product_CANCRUD');
35
-		$product2 = $this->objFromFixture('ProductPage', 'product2');
36
-		$product2->ParentID = ProductHolder::get()->first()->ID;
37
-		$productID = $product2->ID;
34
+        $this->logInWithPermission('Product_CANCRUD');
35
+        $product2 = $this->objFromFixture('ProductPage', 'product2');
36
+        $product2->ParentID = ProductHolder::get()->first()->ID;
37
+        $productID = $product2->ID;
38 38
 
39
-		$product2->doPublish();
40
-		$this->assertTrue($product2->isPublished());
39
+        $product2->doPublish();
40
+        $this->assertTrue($product2->isPublished());
41 41
 
42
-		$versions = DB::query('Select * FROM "ProductPage_versions" WHERE "RecordID" = '. $productID);
43
-		$versionsPostPublish = array();
44
-		foreach($versions as $versionRow) $versionsPostPublish[] = $versionRow;
42
+        $versions = DB::query('Select * FROM "ProductPage_versions" WHERE "RecordID" = '. $productID);
43
+        $versionsPostPublish = array();
44
+        foreach($versions as $versionRow) $versionsPostPublish[] = $versionRow;
45 45
 
46
-		$product2->delete();
47
-		$this->assertTrue(!$product2->isPublished());
46
+        $product2->delete();
47
+        $this->assertTrue(!$product2->isPublished());
48 48
 
49
-		$versions = DB::query('Select * FROM "ProductPage_versions" WHERE "RecordID" = '. $productID);
50
-		$versionsPostDelete = array();
51
-		foreach($versions as $versionRow) $versionsPostDelete[] = $versionRow;
49
+        $versions = DB::query('Select * FROM "ProductPage_versions" WHERE "RecordID" = '. $productID);
50
+        $versionsPostDelete = array();
51
+        foreach($versions as $versionRow) $versionsPostDelete[] = $versionRow;
52 52
 
53
-		$this->assertTrue($versionsPostPublish == $versionsPostDelete);
53
+        $this->assertTrue($versionsPostPublish == $versionsPostDelete);
54 54
 
55
-	}
55
+    }
56 56
 
57
-	function testProductTitleLeadingWhiteSpace(){
57
+    function testProductTitleLeadingWhiteSpace(){
58 58
 
59
-		$this->logInWithPermission('ADMIN');
60
-		$product = $this->objFromFixture('ProductPage', 'product1');
61
-		$product->Title = " Test with leading space";
62
-		$product->ParentID = ProductHolder::get()->first()->ID;
63
-		$product->doPublish();
59
+        $this->logInWithPermission('ADMIN');
60
+        $product = $this->objFromFixture('ProductPage', 'product1');
61
+        $product->Title = " Test with leading space";
62
+        $product->ParentID = ProductHolder::get()->first()->ID;
63
+        $product->doPublish();
64 64
 
65
-		$this->assertTrue($product->Title == 'Test with leading space');
65
+        $this->assertTrue($product->Title == 'Test with leading space');
66 66
 
67
-	}
67
+    }
68 68
 
69
-	function testProductTitleTrailingWhiteSpace(){
69
+    function testProductTitleTrailingWhiteSpace(){
70 70
 
71
-		$this->logInWithPermission('ADMIN');
72
-		$product = $this->objFromFixture('ProductPage', 'product1');
73
-		$product->Title = "Test with trailing space ";
74
-		$product->ParentID = ProductHolder::get()->first()->ID;
75
-		$product->doPublish();
71
+        $this->logInWithPermission('ADMIN');
72
+        $product = $this->objFromFixture('ProductPage', 'product1');
73
+        $product->Title = "Test with trailing space ";
74
+        $product->ParentID = ProductHolder::get()->first()->ID;
75
+        $product->doPublish();
76 76
 
77
-		$this->assertTrue($product->Title == 'Test with trailing space');
77
+        $this->assertTrue($product->Title == 'Test with trailing space');
78 78
 
79
-	}
79
+    }
80 80
 
81
-	function testProductCategoryCreation(){
81
+    function testProductCategoryCreation(){
82 82
 
83
-		$this->logInWithPermission('Product_CANCRUD');
84
-		$category = $this->objFromFixture('ProductCategory', 'apparel');
85
-		$category->write();
86
-		$categoryID = $category->ID;
83
+        $this->logInWithPermission('Product_CANCRUD');
84
+        $category = $this->objFromFixture('ProductCategory', 'apparel');
85
+        $category->write();
86
+        $categoryID = $category->ID;
87 87
 
88
-		$productCategory = ProductCategory::get()->filter(array('Code'=>'APPAREL'))->first();
88
+        $productCategory = ProductCategory::get()->filter(array('Code'=>'APPAREL'))->first();
89 89
 
90
-		$this->assertTrue($categoryID == $productCategory->ID);
90
+        $this->assertTrue($categoryID == $productCategory->ID);
91 91
 
92
-	}
92
+    }
93 93
 
94
-	function testProductCategoryDeletion(){
94
+    function testProductCategoryDeletion(){
95 95
 
96
-		$this->logInWithPermission('Product_CANCRUD');
97
-		$category = $this->objFromFixture('ProductCategory', 'default');
98
-		$category->write();
96
+        $this->logInWithPermission('Product_CANCRUD');
97
+        $category = $this->objFromFixture('ProductCategory', 'default');
98
+        $category->write();
99 99
 
100
-		$this->assertFalse($category->canDelete());
100
+        $this->assertFalse($category->canDelete());
101 101
 
102
-		$category2 = $this->objFromFixture('ProductCategory', 'apparel');
103
-		$category2->write();
104
-		$category2ID = $category2->ID;
102
+        $category2 = $this->objFromFixture('ProductCategory', 'apparel');
103
+        $category2->write();
104
+        $category2ID = $category2->ID;
105 105
 
106
-		$this->assertTrue($category2->canDelete());
106
+        $this->assertTrue($category2->canDelete());
107 107
 
108
-		$this->logOut();
108
+        $this->logOut();
109 109
 
110
-		$this->logInWithPermission('ADMIN');
110
+        $this->logInWithPermission('ADMIN');
111 111
 
112
-		$this->assertFalse($category->canDelete());
113
-		$this->assertTrue($category2->canDelete());
112
+        $this->assertFalse($category->canDelete());
113
+        $this->assertTrue($category2->canDelete());
114 114
 
115
-		$this->logOut();
116
-		$this->logInWithPermission('Product_CANCRUD');
115
+        $this->logOut();
116
+        $this->logInWithPermission('Product_CANCRUD');
117 117
 
118
-		$category2->delete();
118
+        $category2->delete();
119 119
 
120
-		$this->assertFalse(in_array($category2ID,ProductCategory::get()->column('ID')));
120
+        $this->assertFalse(in_array($category2ID,ProductCategory::get()->column('ID')));
121 121
 
122
-	}
122
+    }
123 123
 
124
-	function testOptionGroupCreation(){
124
+    function testOptionGroupCreation(){
125 125
 
126
-		$this->logInWithPermission('Product_CANCRUD');
127
-		$group = $this->objFromFixture('OptionGroup', 'size');
128
-		$group->write();
126
+        $this->logInWithPermission('Product_CANCRUD');
127
+        $group = $this->objFromFixture('OptionGroup', 'size');
128
+        $group->write();
129 129
 
130
-		$this->assertNotNull(OptionGroup::get()->first());
130
+        $this->assertNotNull(OptionGroup::get()->first());
131 131
 
132
-	}
132
+    }
133 133
 
134
-	function testOptionGroupDeletion(){
134
+    function testOptionGroupDeletion(){
135 135
 
136
-		$this->logInWithPermission('ADMIN');
137
-		$group = $this->objFromFixture('OptionGroup', 'color');
138
-		$group->write();
139
-		$groupID = $group->ID;
136
+        $this->logInWithPermission('ADMIN');
137
+        $group = $this->objFromFixture('OptionGroup', 'color');
138
+        $group->write();
139
+        $groupID = $group->ID;
140 140
 
141
-		$this->assertTrue($group->canDelete());
141
+        $this->assertTrue($group->canDelete());
142 142
 
143
-		$this->logOut();
144
-		$this->logInWithPermission('Product_CANCRUD');
143
+        $this->logOut();
144
+        $this->logInWithPermission('Product_CANCRUD');
145 145
 
146
-		$this->assertTrue($group->canDelete());
147
-		$group->delete();
146
+        $this->assertTrue($group->canDelete());
147
+        $group->delete();
148 148
 
149
-		$this->assertFalse(in_array($groupID, OptionGroup::get()->column('ID')));
149
+        $this->assertFalse(in_array($groupID, OptionGroup::get()->column('ID')));
150 150
 
151
-	}
151
+    }
152 152
 
153
-	function testOptionItemCreation(){
153
+    function testOptionItemCreation(){
154 154
 
155
-		$this->logInWithPermission('Product_CANCRUD');
156
-		$optionGroup = OptionGroup::get()->filter(array('Title' => 'Sample-Group'))->first();
157
-		$option = $this->objFromFixture('OptionItem', 'large');
158
-		$option->ProductOptionGroupID = $optionGroup->ID;
159
-		$option->write();
160
-		$optionID = $option->ID;
155
+        $this->logInWithPermission('Product_CANCRUD');
156
+        $optionGroup = OptionGroup::get()->filter(array('Title' => 'Sample-Group'))->first();
157
+        $option = $this->objFromFixture('OptionItem', 'large');
158
+        $option->ProductOptionGroupID = $optionGroup->ID;
159
+        $option->write();
160
+        $optionID = $option->ID;
161 161
 
162
-		$optionItem = OptionItem::get()->filter(array('ProductOptionGroupID' => $optionGroup->ID))->first();
162
+        $optionItem = OptionItem::get()->filter(array('ProductOptionGroupID' => $optionGroup->ID))->first();
163 163
 
164
-		$this->assertEquals($optionID, $optionItem->ID);
164
+        $this->assertEquals($optionID, $optionItem->ID);
165 165
 
166
-	}
166
+    }
167 167
 
168
-	function testOptionItemDeletion(){
168
+    function testOptionItemDeletion(){
169 169
 
170
-		$this->logInWithPermission('ADMIN');
171
-		$optionGroup = (OptionGroup::get()->first())
172
-			? OptionGroup::get()->first()
173
-			: OptionGroup::create();
174
-		if($optionGroup->ID == 0){
175
-			$optionGroup->Title = 'Size';
176
-			$optionGroup->write();
177
-		}
178
-		$option = $this->objFromFixture('OptionItem', 'small');
179
-		$option->ProductOptionGroupID = $optionGroup->ID;
180
-		$option->write();
181
-		$optionID = $option->ID;
170
+        $this->logInWithPermission('ADMIN');
171
+        $optionGroup = (OptionGroup::get()->first())
172
+            ? OptionGroup::get()->first()
173
+            : OptionGroup::create();
174
+        if($optionGroup->ID == 0){
175
+            $optionGroup->Title = 'Size';
176
+            $optionGroup->write();
177
+        }
178
+        $option = $this->objFromFixture('OptionItem', 'small');
179
+        $option->ProductOptionGroupID = $optionGroup->ID;
180
+        $option->write();
181
+        $optionID = $option->ID;
182 182
 
183
-		$this->assertTrue($option->canDelete());
183
+        $this->assertTrue($option->canDelete());
184 184
 
185
-		$this->logOut();
186
-		$this->logInWithPermission('Product_CANCRUD');
185
+        $this->logOut();
186
+        $this->logInWithPermission('Product_CANCRUD');
187 187
 
188
-		$this->assertTrue($option->canDelete());
189
-		$option->delete();
188
+        $this->assertTrue($option->canDelete());
189
+        $option->delete();
190 190
 
191
-		$this->assertFalse(in_array($optionID, OptionItem::get()->column('ID')));
191
+        $this->assertFalse(in_array($optionID, OptionItem::get()->column('ID')));
192 192
 
193
-	}
193
+    }
194 194
 
195 195
 }
Please login to merge, or discard this patch.