@@ -2,79 +2,79 @@ |
||
2 | 2 | |
3 | 3 | class ProductDiscountTierTest 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 | - $productHolder = ProductHolder::create(); |
|
11 | - $productHolder->Title = 'Product Holder'; |
|
12 | - $productHolder->write(); |
|
10 | + $productHolder = ProductHolder::create(); |
|
11 | + $productHolder->Title = 'Product Holder'; |
|
12 | + $productHolder->write(); |
|
13 | 13 | |
14 | - $product = $this->objFromFixture('ProductPage', 'product1'); |
|
15 | - $product->ParentID = $productHolder->ID; |
|
16 | - $product->write(); |
|
17 | - } |
|
14 | + $product = $this->objFromFixture('ProductPage', 'product1'); |
|
15 | + $product->ParentID = $productHolder->ID; |
|
16 | + $product->write(); |
|
17 | + } |
|
18 | 18 | |
19 | - public function testProductDiscountTierCreation(){ |
|
20 | - $this->logInWithPermission('Product_CANCRUD'); |
|
19 | + public function testProductDiscountTierCreation(){ |
|
20 | + $this->logInWithPermission('Product_CANCRUD'); |
|
21 | 21 | |
22 | - $discount = ProductPage::get()->first(); |
|
22 | + $discount = ProductPage::get()->first(); |
|
23 | 23 | |
24 | - $tier = $this->objFromFixture('ProductDiscountTier', 'fiveforten'); |
|
25 | - $tier->ProductPageID = $discount->ID; |
|
26 | - $tier->write(); |
|
27 | - $tierID = $tier->ID; |
|
24 | + $tier = $this->objFromFixture('ProductDiscountTier', 'fiveforten'); |
|
25 | + $tier->ProductPageID = $discount->ID; |
|
26 | + $tier->write(); |
|
27 | + $tierID = $tier->ID; |
|
28 | 28 | |
29 | - $checkTier = ProductDiscountTier::get()->byID($tierID); |
|
29 | + $checkTier = ProductDiscountTier::get()->byID($tierID); |
|
30 | 30 | |
31 | - $this->assertEquals($checkTier->Quantity, 5); |
|
32 | - $this->assertEquals($checkTier->Percentage, 10); |
|
31 | + $this->assertEquals($checkTier->Quantity, 5); |
|
32 | + $this->assertEquals($checkTier->Percentage, 10); |
|
33 | 33 | |
34 | - $this->logOut(); |
|
35 | - } |
|
34 | + $this->logOut(); |
|
35 | + } |
|
36 | 36 | |
37 | - public function testProductDiscountTierEdit(){ |
|
38 | - $this->logInWithPermission('ADMIN'); |
|
37 | + public function testProductDiscountTierEdit(){ |
|
38 | + $this->logInWithPermission('ADMIN'); |
|
39 | 39 | |
40 | - $discount = ProductPage::get()->first(); |
|
40 | + $discount = ProductPage::get()->first(); |
|
41 | 41 | |
42 | - $tier = $this->objFromFixture('ProductDiscountTier', 'fiveforten'); |
|
43 | - $tier->ProductPageID = $discount->ID; |
|
44 | - $tier->write(); |
|
45 | - $tierID = $tier->ID; |
|
46 | - $this->logInWithPermission('Product_CANCRUD'); |
|
42 | + $tier = $this->objFromFixture('ProductDiscountTier', 'fiveforten'); |
|
43 | + $tier->ProductPageID = $discount->ID; |
|
44 | + $tier->write(); |
|
45 | + $tierID = $tier->ID; |
|
46 | + $this->logInWithPermission('Product_CANCRUD'); |
|
47 | 47 | |
48 | - $tier->Quantity = 2; |
|
49 | - $tier->Percentage = 5; |
|
50 | - $tier->write(); |
|
48 | + $tier->Quantity = 2; |
|
49 | + $tier->Percentage = 5; |
|
50 | + $tier->write(); |
|
51 | 51 | |
52 | - $checkTier = ProductDiscountTier::get()->byID($tierID); |
|
52 | + $checkTier = ProductDiscountTier::get()->byID($tierID); |
|
53 | 53 | |
54 | - $this->assertEquals($checkTier->Quantity, 2); |
|
55 | - $this->assertEquals($checkTier->Percentage, 5); |
|
54 | + $this->assertEquals($checkTier->Quantity, 2); |
|
55 | + $this->assertEquals($checkTier->Percentage, 5); |
|
56 | 56 | |
57 | - $this->logOut(); |
|
58 | - } |
|
57 | + $this->logOut(); |
|
58 | + } |
|
59 | 59 | |
60 | - public function testProductDiscountTierDeletion(){ |
|
61 | - $this->logInWithPermission('ADMIN'); |
|
60 | + public function testProductDiscountTierDeletion(){ |
|
61 | + $this->logInWithPermission('ADMIN'); |
|
62 | 62 | |
63 | - $discount = ProductPage::get()->first(); |
|
63 | + $discount = ProductPage::get()->first(); |
|
64 | 64 | |
65 | - $tier = $this->objFromFixture('ProductDiscountTier', 'fiveforten'); |
|
66 | - $tier->ProductPageID = $discount->ID; |
|
67 | - $tier->write(); |
|
68 | - $tierID = $tier->ID; |
|
65 | + $tier = $this->objFromFixture('ProductDiscountTier', 'fiveforten'); |
|
66 | + $tier->ProductPageID = $discount->ID; |
|
67 | + $tier->write(); |
|
68 | + $tierID = $tier->ID; |
|
69 | 69 | |
70 | - $this->logOut(); |
|
70 | + $this->logOut(); |
|
71 | 71 | |
72 | - $this->logInWithPermission('Product_CANCRUD'); |
|
72 | + $this->logInWithPermission('Product_CANCRUD'); |
|
73 | 73 | |
74 | - $tier->delete(); |
|
75 | - $this->assertTrue(!ProductDiscountTier::get()->byID($tierID)); |
|
74 | + $tier->delete(); |
|
75 | + $this->assertTrue(!ProductDiscountTier::get()->byID($tierID)); |
|
76 | 76 | |
77 | - $this->logOut(); |
|
78 | - } |
|
77 | + $this->logOut(); |
|
78 | + } |
|
79 | 79 | |
80 | 80 | } |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -class ProductDiscountTierTest extends FS_Test{ |
|
3 | +class ProductDiscountTierTest extends FS_Test { |
|
4 | 4 | |
5 | 5 | protected static $use_draft_site = true; |
6 | 6 | |
7 | - function setUp(){ |
|
7 | + function setUp() { |
|
8 | 8 | parent::setUp(); |
9 | 9 | |
10 | 10 | $productHolder = ProductHolder::create(); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $product->write(); |
17 | 17 | } |
18 | 18 | |
19 | - public function testProductDiscountTierCreation(){ |
|
19 | + public function testProductDiscountTierCreation() { |
|
20 | 20 | $this->logInWithPermission('Product_CANCRUD'); |
21 | 21 | |
22 | 22 | $discount = ProductPage::get()->first(); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $this->logOut(); |
35 | 35 | } |
36 | 36 | |
37 | - public function testProductDiscountTierEdit(){ |
|
37 | + public function testProductDiscountTierEdit() { |
|
38 | 38 | $this->logInWithPermission('ADMIN'); |
39 | 39 | |
40 | 40 | $discount = ProductPage::get()->first(); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $this->logOut(); |
58 | 58 | } |
59 | 59 | |
60 | - public function testProductDiscountTierDeletion(){ |
|
60 | + public function testProductDiscountTierDeletion() { |
|
61 | 61 | $this->logInWithPermission('ADMIN'); |
62 | 62 | |
63 | 63 | $discount = ProductPage::get()->first(); |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -class FS_Test extends FunctionalTest{ |
|
3 | +class FS_Test extends FunctionalTest { |
|
4 | 4 | |
5 | 5 | protected static $fixture_file = 'foxystripe/tests/FoxyStripeTest.yml'; |
6 | 6 | protected static $disable_themes = true; |
7 | 7 | protected static $use_draft_site = false; |
8 | 8 | |
9 | - public function setUp(){ |
|
9 | + public function setUp() { |
|
10 | 10 | parent::setUp(); |
11 | 11 | |
12 | 12 | ini_set('display_errors', 1); |
@@ -14,10 +14,10 @@ discard block |
||
14 | 14 | error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED); |
15 | 15 | } |
16 | 16 | |
17 | - public function logOut(){ |
|
17 | + public function logOut() { |
|
18 | 18 | $this->session()->clear('loggedInAs'); |
19 | 19 | } |
20 | 20 | |
21 | - public function testProductPage(){} |
|
21 | + public function testProductPage() {} |
|
22 | 22 | |
23 | 23 | } |