1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* CakePHPify : CakePHP Plugin for Shopify API Authentication |
4
|
|
|
* Copyright (c) Multidimension.al (http://multidimension.al) |
5
|
|
|
* Github : https://github.com/multidimension-al/cakephpify |
6
|
|
|
* |
7
|
|
|
* Licensed under The MIT License |
8
|
|
|
* For full copyright and license information, please see the LICENSE file |
9
|
|
|
* Redistributions of files must retain the above copyright notice. |
10
|
|
|
* |
11
|
|
|
* @copyright (c) Multidimension.al (http://multidimension.al) |
12
|
|
|
* @link https://github.com/multidimension-al/cakephpify CakePHPify Github |
13
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php MIT License |
14
|
|
|
*/ |
15
|
|
|
|
16
|
|
|
namespace Multidimensional\Shopify\Tests\Controller\Component; |
17
|
|
|
|
18
|
|
|
use Multidimensional\Shopify\Controller\Component\ShopifyAPIComponent; |
19
|
|
|
|
20
|
|
|
use Cake\Controller\Controller; |
21
|
|
|
use Cake\Controller\ComponentRegistry; |
22
|
|
|
use Cake\Event\Event; |
23
|
|
|
use Cake\Network\Request; |
24
|
|
|
use Cake\Network\Response; |
25
|
|
|
use Cake\TestSuite\TestCase; |
26
|
|
|
|
27
|
|
|
class ShopifyAPIComponentTest extends TestCase { |
28
|
|
|
|
29
|
|
|
public $component = null; |
30
|
|
|
public $controller = null; |
31
|
|
|
public $fixtures = ['plugin.Multidimensional/Shopify.Shops', 'plugin.Multidimensional/Shopify.AccessTokens']; |
32
|
|
|
|
33
|
|
|
public function setUp() { |
34
|
|
|
parent::setUp(); |
35
|
|
|
$request = new Request(); |
36
|
|
|
$response = new Response(); |
37
|
|
|
$this->controller = $this->getMockBuilder('Cake\Controller\Controller') |
38
|
|
|
->setConstructorArgs([$request, $response]) |
39
|
|
|
->setMethods(null) |
40
|
|
|
->getMock(); |
41
|
|
|
$registry = new ComponentRegistry($this->controller); |
42
|
|
|
$this->component = new ShopifyAPIComponent($registry); |
43
|
|
|
$event = new Event('Controller.startup', $this->controller); |
44
|
|
|
$this->component->startup($event); |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
public function tearDown() { |
48
|
|
|
parent::tearDown(); |
49
|
|
|
unset($this->component, $this->controller); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
public function testSetShopDomain() { |
53
|
|
|
|
54
|
|
|
|
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
public function testGetShopDomain() { |
58
|
|
|
|
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
public function testSetAccessToken() { |
62
|
|
|
|
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
public function testGetAuthorizeUrl() { |
66
|
|
|
|
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
public function testGetAccessToken() { |
70
|
|
|
|
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
public function testSetNonce() { |
74
|
|
|
|
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
public function testGetNonce() { |
78
|
|
|
|
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
} |
82
|
|
|
|