@@ -37,14 +37,14 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | parent::setUp(); |
| 39 | 39 | |
| 40 | - Configure::write('Multidimensional/Cakephpify', [ |
|
| 41 | - 'abc123' => |
|
| 42 | - [ |
|
| 43 | - 'sharedSecret' => 'abc123', |
|
| 44 | - 'scope' => '', |
|
| 45 | - 'privateApp' => false, |
|
| 46 | - 'privateAppPassword' => NULL] |
|
| 47 | - ]); |
|
| 40 | + Configure::write('Multidimensional/Cakephpify', [ |
|
| 41 | + 'abc123' => |
|
| 42 | + [ |
|
| 43 | + 'sharedSecret' => 'abc123', |
|
| 44 | + 'scope' => '', |
|
| 45 | + 'privateApp' => false, |
|
| 46 | + 'privateAppPassword' => NULL] |
|
| 47 | + ]); |
|
| 48 | 48 | |
| 49 | 49 | $request = new Request(); |
| 50 | 50 | $response = new Response(); |
@@ -66,54 +66,54 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | public function testShopDomain() |
| 68 | 68 | { |
| 69 | - $shopDomain = "test.myshopify.com"; |
|
| 70 | - $return = $this->component->setShopDomain($shopDomain); |
|
| 71 | - $this->assertSame($return, $shopDomain); |
|
| 72 | - $return = $this->component->getShopDomain(); |
|
| 73 | - $this->assertSame($return, $shopDomain); |
|
| 74 | - |
|
| 75 | - $shopDomain = "random.myshopify.com"; |
|
| 76 | - $this->component->setShopDomain($shopDomain); |
|
| 77 | - $return = $this->component->setShopDomain($shopDomain); |
|
| 78 | - $this->assertSame($return, $shopDomain); |
|
| 79 | - $return = $this->component->getShopDomain(); |
|
| 80 | - $this->assertSame($return, $shopDomain); |
|
| 81 | - |
|
| 82 | - $shopDomain = NULL; |
|
| 83 | - $return = $this->component->setShopDomain($shopDomain); |
|
| 84 | - $this->assertNull($return); |
|
| 85 | - $return = $this->component->getShopDomain(); |
|
| 86 | - $this->assertNull($return); |
|
| 87 | - |
|
| 88 | - $shopDomain = false; |
|
| 89 | - $return = $this->component->setShopDomain($shopDomain); |
|
| 90 | - $this->assertFalse($return); |
|
| 91 | - $return = $this->component->getShopDomain(); |
|
| 92 | - $this->assertFalse($return); |
|
| 93 | - |
|
| 94 | - $shopDomain = true; |
|
| 95 | - $return = $this->component->setShopDomain($shopDomain); |
|
| 96 | - $this->assertTrue($return); |
|
| 97 | - $return = $this->component->getShopDomain(); |
|
| 98 | - $this->assertTrue($return); |
|
| 99 | - |
|
| 100 | - $shopDomain = "test.myshopify.com"; |
|
| 101 | - $return = $this->component->validDomain($shopDomain); |
|
| 102 | - $this->assertTrue($return); |
|
| 103 | - |
|
| 104 | - $shopDomain = "TEST.MYshopify.COM"; |
|
| 105 | - $return = $this->component->validDomain($shopDomain); |
|
| 106 | - $this->assertTrue($return); |
|
| 107 | - |
|
| 108 | - $shopDomain = "random.myshopify.com"; |
|
| 109 | - $return = $this->component->validDomain($shopDomain); |
|
| 110 | - $this->assertTrue($return); |
|
| 111 | - |
|
| 112 | - $shopDomain = "www.myshopify.com"; |
|
| 113 | - $return = $this->component->validDomain($shopDomain); |
|
| 114 | - $this->assertTrue($return); |
|
| 115 | - |
|
| 116 | - /*$shopDomain = "test.myshopify.net"; |
|
| 69 | + $shopDomain = "test.myshopify.com"; |
|
| 70 | + $return = $this->component->setShopDomain($shopDomain); |
|
| 71 | + $this->assertSame($return, $shopDomain); |
|
| 72 | + $return = $this->component->getShopDomain(); |
|
| 73 | + $this->assertSame($return, $shopDomain); |
|
| 74 | + |
|
| 75 | + $shopDomain = "random.myshopify.com"; |
|
| 76 | + $this->component->setShopDomain($shopDomain); |
|
| 77 | + $return = $this->component->setShopDomain($shopDomain); |
|
| 78 | + $this->assertSame($return, $shopDomain); |
|
| 79 | + $return = $this->component->getShopDomain(); |
|
| 80 | + $this->assertSame($return, $shopDomain); |
|
| 81 | + |
|
| 82 | + $shopDomain = NULL; |
|
| 83 | + $return = $this->component->setShopDomain($shopDomain); |
|
| 84 | + $this->assertNull($return); |
|
| 85 | + $return = $this->component->getShopDomain(); |
|
| 86 | + $this->assertNull($return); |
|
| 87 | + |
|
| 88 | + $shopDomain = false; |
|
| 89 | + $return = $this->component->setShopDomain($shopDomain); |
|
| 90 | + $this->assertFalse($return); |
|
| 91 | + $return = $this->component->getShopDomain(); |
|
| 92 | + $this->assertFalse($return); |
|
| 93 | + |
|
| 94 | + $shopDomain = true; |
|
| 95 | + $return = $this->component->setShopDomain($shopDomain); |
|
| 96 | + $this->assertTrue($return); |
|
| 97 | + $return = $this->component->getShopDomain(); |
|
| 98 | + $this->assertTrue($return); |
|
| 99 | + |
|
| 100 | + $shopDomain = "test.myshopify.com"; |
|
| 101 | + $return = $this->component->validDomain($shopDomain); |
|
| 102 | + $this->assertTrue($return); |
|
| 103 | + |
|
| 104 | + $shopDomain = "TEST.MYshopify.COM"; |
|
| 105 | + $return = $this->component->validDomain($shopDomain); |
|
| 106 | + $this->assertTrue($return); |
|
| 107 | + |
|
| 108 | + $shopDomain = "random.myshopify.com"; |
|
| 109 | + $return = $this->component->validDomain($shopDomain); |
|
| 110 | + $this->assertTrue($return); |
|
| 111 | + |
|
| 112 | + $shopDomain = "www.myshopify.com"; |
|
| 113 | + $return = $this->component->validDomain($shopDomain); |
|
| 114 | + $this->assertTrue($return); |
|
| 115 | + |
|
| 116 | + /*$shopDomain = "test.myshopify.net"; |
|
| 117 | 117 | $return = $this->component->validDomain($shopDomain); |
| 118 | 118 | $this->assertFalse($return); |
| 119 | 119 | |
@@ -155,35 +155,35 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | public function testNonce() |
| 157 | 157 | { |
| 158 | - $nonce = md5(rand()); |
|
| 159 | - $return = $this->component->setNonce($nonce); |
|
| 160 | - $this->assertSame($return, $nonce); |
|
| 161 | - $return = $this->component->getNonce(); |
|
| 162 | - $this->assertSame($return, $nonce); |
|
| 163 | - |
|
| 164 | - $nonce = md5(rand()); |
|
| 165 | - $this->component->setNonce($nonce); |
|
| 166 | - $return = $this->component->setNonce($nonce); |
|
| 167 | - $this->assertSame($return, $nonce); |
|
| 168 | - $return = $this->component->getNonce(); |
|
| 169 | - $this->assertSame($return, $nonce); |
|
| 170 | - |
|
| 171 | - $nonce = NULL; |
|
| 172 | - $return = $this->component->setNonce($nonce); |
|
| 173 | - $this->assertNull($return); |
|
| 174 | - $return = $this->component->getNonce(); |
|
| 175 | - $this->assertNull($return); |
|
| 176 | - |
|
| 177 | - $nonce = false; |
|
| 178 | - $return = $this->component->setNonce($nonce); |
|
| 179 | - $this->assertFalse($return); |
|
| 180 | - $return = $this->component->getNonce(); |
|
| 181 | - $this->assertFalse($return); |
|
| 182 | - |
|
| 183 | - $nonce = true; |
|
| 184 | - $return = $this->component->setNonce($nonce); |
|
| 185 | - $this->assertTrue($return); |
|
| 186 | - $return = $this->component->getNonce(); |
|
| 187 | - $this->assertTrue($return); |
|
| 158 | + $nonce = md5(rand()); |
|
| 159 | + $return = $this->component->setNonce($nonce); |
|
| 160 | + $this->assertSame($return, $nonce); |
|
| 161 | + $return = $this->component->getNonce(); |
|
| 162 | + $this->assertSame($return, $nonce); |
|
| 163 | + |
|
| 164 | + $nonce = md5(rand()); |
|
| 165 | + $this->component->setNonce($nonce); |
|
| 166 | + $return = $this->component->setNonce($nonce); |
|
| 167 | + $this->assertSame($return, $nonce); |
|
| 168 | + $return = $this->component->getNonce(); |
|
| 169 | + $this->assertSame($return, $nonce); |
|
| 170 | + |
|
| 171 | + $nonce = NULL; |
|
| 172 | + $return = $this->component->setNonce($nonce); |
|
| 173 | + $this->assertNull($return); |
|
| 174 | + $return = $this->component->getNonce(); |
|
| 175 | + $this->assertNull($return); |
|
| 176 | + |
|
| 177 | + $nonce = false; |
|
| 178 | + $return = $this->component->setNonce($nonce); |
|
| 179 | + $this->assertFalse($return); |
|
| 180 | + $return = $this->component->getNonce(); |
|
| 181 | + $this->assertFalse($return); |
|
| 182 | + |
|
| 183 | + $nonce = true; |
|
| 184 | + $return = $this->component->setNonce($nonce); |
|
| 185 | + $this->assertTrue($return); |
|
| 186 | + $return = $this->component->getNonce(); |
|
| 187 | + $this->assertTrue($return); |
|
| 188 | 188 | } |
| 189 | 189 | } |