Repository navigation
Expand file tree
/
Copy pathtestcase.php
More file actions
157 lines (134 loc) · 3.49 KB
/
Copy pathtestcase.php
File metadata and controls
157 lines (134 loc) · 3.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?php
abstract class Writing_On_GitHub_TestCase extends WP_HTTP_TestCase {
/**
* @var string
*/
protected $data_dir;
/**
* @var Writing_On_GitHub|Mockery\Mock
*/
protected $app;
/**
* @var Writing_On_GitHub_Controller|Mockery\Mock
*/
protected $controller;
/**
* @var Writing_On_GitHub_Request|Mockery\Mock
*/
protected $request;
/**
* @var Writing_On_GitHub_Import|Mockery\Mock
*/
protected $import;
/**
* @var Writing_On_GitHub_Export|Mockery\Mock
*/
protected $export;
/**
* @var Writing_On_GitHub_Response|Mockery\Mock
*/
protected $response;
/**
* @var Writing_On_GitHub_Payload|Mockery\Mock
*/
protected $payload;
/**
* @var Writing_On_GitHub_Api|Mockery\Mock
*/
protected $api;
/**
* @var Writing_On_GitHub_Semaphore|Mockery\Mock
*/
protected $semaphore;
/**
* @var Writing_On_GitHub_Database|Mockery\Mock
*/
protected $database;
/**
* @var Writing_On_GitHub_Post|Mockery\Mock
*/
protected $post;
/**
* @var Writing_On_GitHub_Blob|Mockery\Mock
*/
protected $blob;
/**
* @var Writing_On_GitHub_Cache|Mockery\Mock
*/
protected $api_cache;
/**
* @var Writing_On_GitHub_Fetch_Client|Mockery\Mock
*/
protected $fetch;
/**
* @var Writing_On_GitHub_Persist_Client|Mockery\Mock
*/
protected $persist;
public function setUp() {
parent::setUp();
$this->data_dir = dirname( __DIR__ ) . '/data/';
$this->app = Mockery::mock( 'Writing_On_GitHub' );
$this->controller = Mockery::mock( 'Writing_On_GitHub_Controller' );
$this->request = Mockery::mock( 'Writing_On_GitHub_Request' );
$this->import = Mockery::mock( 'Writing_On_GitHub_Import' );
$this->export = Mockery::mock( 'Writing_On_GitHub_Export' );
$this->response = Mockery::mock( 'Writing_On_GitHub_Response' );
$this->payload = Mockery::mock( 'Writing_On_GitHub_Payload' );
$this->api = Mockery::mock( 'Writing_On_GitHub_Api' );
$this->semaphore = Mockery::mock( 'Writing_On_GitHub_Semaphore' );
$this->database = Mockery::mock( 'Writing_On_GitHub_Database' );
$this->post = Mockery::mock( 'Writing_On_GitHub_Post' );
$this->blob = Mockery::mock( 'Writing_On_GitHub_Blob' );
$this->api_cache = Mockery::mock( 'Writing_On_GitHub_Cache' );
$this->fetch = Mockery::mock( 'Writing_On_GitHub_Fetch_Client' );
$this->persist = Mockery::mock( 'Writing_On_GitHub_Persist_Client' );
Writing_On_GitHub::$instance = $this->app;
$this->app
->shouldReceive( 'request' )
->andReturn( $this->request )
->byDefault();
$this->app
->shouldReceive( 'import' )
->andReturn( $this->import )
->byDefault();
$this->app
->shouldReceive( 'export' )
->andReturn( $this->export )
->byDefault();
$this->app
->shouldReceive( 'response' )
->andReturn( $this->response )
->byDefault();
$this->app
->shouldReceive( 'api' )
->andReturn( $this->api )
->byDefault();
$this->app
->shouldReceive( 'semaphore' )
->andReturn( $this->semaphore )
->byDefault();
$this->app
->shouldReceive( 'database' )
->andReturn( $this->database )
->byDefault();
$this->app
->shouldReceive( 'blob' )
->andReturn( $this->blob )
->byDefault();
$this->app
->shouldReceive( 'cache' )
->andReturn( $this->api_cache )
->byDefault();
$this->api
->shouldReceive( 'fetch' )
->andReturn( $this->fetch )
->byDefault();
$this->api
->shouldReceive( 'persist' )
->andReturn( $this->persist )
->byDefault();
}
public function tearDown() {
Mockery::close();
}
}