Completed
Pull Request — master (#287)
by Nic
04:34
created
tests/ProductPageTest.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 
5 5
 	protected static $use_draft_site = true;
6 6
 
7
-	function setUp(){
7
+	function setUp() {
8 8
 
9 9
 		$groupForItem = OptionGroup::create();
10 10
 		$groupForItem->Title = 'Sample-Group';
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 		$productHolder->write();
16 16
 	}
17 17
 
18
-	function testProductCreation(){
18
+	function testProductCreation() {
19 19
 
20 20
 		$this->logInWithPermission('Product_CANCRUD');
21 21
 		$default = $this->objFromFixture('ProductCategory', 'default');
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
 	}
30 30
 
31
-	function testProductDeletion(){
31
+	function testProductDeletion() {
32 32
 
33 33
 		$this->logInWithPermission('Product_CANCRUD');
34 34
 		$product2 = $this->objFromFixture('ProductPage', 'product2');
@@ -38,22 +38,22 @@  discard block
 block discarded – undo
38 38
 		$product2->doPublish();
39 39
 		$this->assertTrue($product2->isPublished());
40 40
 
41
-		$versions = DB::query('Select * FROM "ProductPage_versions" WHERE "RecordID" = '. $productID);
41
+		$versions = DB::query('Select * FROM "ProductPage_versions" WHERE "RecordID" = '.$productID);
42 42
 		$versionsPostPublish = array();
43
-		foreach($versions as $versionRow) $versionsPostPublish[] = $versionRow;
43
+		foreach ($versions as $versionRow) $versionsPostPublish[] = $versionRow;
44 44
 
45 45
 		$product2->delete();
46 46
 		$this->assertTrue(!$product2->isPublished());
47 47
 
48
-		$versions = DB::query('Select * FROM "ProductPage_versions" WHERE "RecordID" = '. $productID);
48
+		$versions = DB::query('Select * FROM "ProductPage_versions" WHERE "RecordID" = '.$productID);
49 49
 		$versionsPostDelete = array();
50
-		foreach($versions as $versionRow) $versionsPostDelete[] = $versionRow;
50
+		foreach ($versions as $versionRow) $versionsPostDelete[] = $versionRow;
51 51
 
52 52
 		$this->assertTrue($versionsPostPublish == $versionsPostDelete);
53 53
 
54 54
 	}
55 55
 
56
-	function testProductTitleLeadingWhiteSpace(){
56
+	function testProductTitleLeadingWhiteSpace() {
57 57
 
58 58
 		$this->logInWithPermission('ADMIN');
59 59
 		$product = $this->objFromFixture('ProductPage', 'product1');
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
 	}
67 67
 
68
-	function testProductTitleTrailingWhiteSpace(){
68
+	function testProductTitleTrailingWhiteSpace() {
69 69
 
70 70
 		$this->logInWithPermission('ADMIN');
71 71
 		$product = $this->objFromFixture('ProductPage', 'product1');
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
 	}
79 79
 
80
-	function testProductCategoryCreation(){
80
+	function testProductCategoryCreation() {
81 81
 
82 82
 		$this->logInWithPermission('Product_CANCRUD');
83 83
 		$category = $this->objFromFixture('ProductCategory', 'apparel');
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
 	}
92 92
 
93
-	function testProductCategoryDeletion(){
93
+	function testProductCategoryDeletion() {
94 94
 
95 95
 		$this->logInWithPermission('Product_CANCRUD');
96 96
 		$category = $this->objFromFixture('ProductCategory', 'default');
@@ -116,11 +116,11 @@  discard block
 block discarded – undo
116 116
 
117 117
 		$category2->delete();
118 118
 
119
-		$this->assertFalse(in_array($category2ID,ProductCategory::get()->column('ID')));
119
+		$this->assertFalse(in_array($category2ID, ProductCategory::get()->column('ID')));
120 120
 
121 121
 	}
122 122
 
123
-	function testOptionGroupCreation(){
123
+	function testOptionGroupCreation() {
124 124
 
125 125
 		$this->logInWithPermission('Product_CANCRUD');
126 126
 		$group = $this->objFromFixture('OptionGroup', 'size');
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
 	}
132 132
 
133
-	function testOptionGroupDeletion(){
133
+	function testOptionGroupDeletion() {
134 134
 
135 135
 		$this->logInWithPermission('ADMIN');
136 136
 		$group = $this->objFromFixture('OptionGroup', 'color');
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
 	}
151 151
 
152
-	function testOptionItemCreation(){
152
+	function testOptionItemCreation() {
153 153
 
154 154
 		$this->logInWithPermission('Product_CANCRUD');
155 155
 		$optionGroup = OptionGroup::get()->filter(array('Title' => 'Sample-Group'))->first();
@@ -164,13 +164,13 @@  discard block
 block discarded – undo
164 164
 
165 165
 	}
166 166
 
167
-	function testOptionItemDeletion(){
167
+	function testOptionItemDeletion() {
168 168
 
169 169
 		$this->logInWithPermission('ADMIN');
170 170
 		$optionGroup = (OptionGroup::get()->first())
171 171
 			? OptionGroup::get()->first()
172 172
 			: OptionGroup::create();
173
-		if($optionGroup->ID == 0){
173
+		if ($optionGroup->ID == 0) {
174 174
 			$optionGroup->Title = 'Size';
175 175
 			$optionGroup->write();
176 176
 		}
Please login to merge, or discard this patch.