@@ -21,47 +21,7 @@ public function shouldGetAllBoards()
21
21
22
22
$ this ->assertEquals ($ expectedArray , $ api ->all ());
23
23
}
24
- //
25
- // /**
26
- // * @test
27
- // */
28
- // public function shouldGetProjectIssuesWithPagination()
29
- // {
30
- // $expectedArray = array(
31
- // array('id' => 1, 'title' => 'An issue'),
32
- // array('id' => 2, 'title' => 'Another issue'),
33
- // );
34
- //
35
- // $api = $this->getApiMock();
36
- // $api->expects($this->once())
37
- // ->method('get')
38
- // ->with('projects/1/issues', array('page' => 2, 'per_page' => 5))
39
- // ->will($this->returnValue($expectedArray))
40
- // ;
41
- //
42
- // $this->assertEquals($expectedArray, $api->all(1, 2, 5));
43
- // }
44
- //
45
- // /**
46
- // * @test
47
- // */
48
- // public function shouldGetProjectIssuesWithParams()
49
- // {
50
- // $expectedArray = array(
51
- // array('id' => 1, 'title' => 'An issue'),
52
- // array('id' => 2, 'title' => 'Another issue'),
53
- // );
54
- //
55
- // $api = $this->getApiMock();
56
- // $api->expects($this->once())
57
- // ->method('get')
58
- // ->with('projects/1/issues', array('page' => 2, 'per_page' => 5, 'order_by' => 'created_at', 'sort' => 'desc', 'labels' => 'foo,bar', 'state' => 'open'))
59
- // ->will($this->returnValue($expectedArray))
60
- // ;
61
- //
62
- // $this->assertEquals($expectedArray, $api->all(1, 2, 5, array('order_by' => 'created_at', 'sort' => 'desc', 'labels' => 'foo,bar', 'state' => 'open')));
63
- // }
64
-
24
+
65
25
/**
66
26
* @test
67
27
*/
@@ -130,77 +90,138 @@ public function shouldRemoveIssueBoard()
130
90
$ this ->assertEquals ($ expectedBool , $ api ->remove (1 , 2 ));
131
91
}
132
92
133
- // /**
134
- // * @test
135
- // */
136
- // public function shouldGetIssueComments()
137
- // {
138
- // $expectedArray = array(
139
- // array('id' => 1, 'body' => 'A comment'),
140
- // array('id' => 2, 'body' => 'Another comment')
141
- // );
142
- //
143
- // $api = $this->getApiMock();
144
- // $api->expects($this->once())
145
- // ->method('get')
146
- // ->with('projects/1/issues/2/notes')
147
- // ->will($this->returnValue($expectedArray))
148
- // ;
149
- //
150
- // $this->assertEquals($expectedArray, $api->showComments(1, 2));
151
- // }
152
- //
153
- // /**
154
- // * @test
155
- // */
156
- // public function shouldGetIssueComment()
157
- // {
158
- // $expectedArray = array('id' => 3, 'body' => 'A new comment');
159
- //
160
- // $api = $this->getApiMock();
161
- // $api->expects($this->once())
162
- // ->method('get')
163
- // ->with('projects/1/issues/2/notes/3')
164
- // ->will($this->returnValue($expectedArray))
165
- // ;
166
- //
167
- // $this->assertEquals($expectedArray, $api->showComment(1, 2, 3));
168
- // }
169
- //
170
- // /**
171
- // * @test
172
- // */
173
- // public function shouldCreateComment()
174
- // {
175
- // $expectedArray = array('id' => 3, 'body' => 'A new comment');
176
- //
177
- // $api = $this->getApiMock();
178
- // $api->expects($this->exactly(2))
179
- // ->method('post')
180
- // ->with('projects/1/issues/2/notes', array('body' => 'A new comment'))
181
- // ->will($this->returnValue($expectedArray))
182
- // ;
183
- //
184
- // $this->assertEquals($expectedArray, $api->addComment(1, 2, array('body' => 'A new comment')));
185
- // $this->assertEquals($expectedArray, $api->addComment(1, 2, 'A new comment'));
186
- // }
187
- //
188
- // /**
189
- // * @test
190
- // */
191
- // public function shouldUpdateComment()
192
- // {
193
- // $expectedArray = array('id' => 3, 'body' => 'An edited comment');
194
- //
195
- // $api = $this->getApiMock();
196
- // $api->expects($this->once())
197
- // ->method('put')
198
- // ->with('projects/1/issues/2/notes/3', array('body' => 'An edited comment'))
199
- // ->will($this->returnValue($expectedArray))
200
- // ;
201
- //
202
- // $this->assertEquals($expectedArray, $api->updateComment(1, 2, 3, 'An edited comment'));
203
- // }
93
+ /**
94
+ * @test
95
+ */
96
+ public function shouldGetAllLists ()
97
+ {
98
+ $ expectedArray = array (
99
+ array (
100
+ 'id ' => 1 ,
101
+ 'label ' => array (
102
+ 'name ' => 'First label ' ,
103
+ 'color ' => '#F0AD4E ' ,
104
+ 'description ' => null
105
+ ),
106
+ 'position ' => 1
107
+ ), array (
108
+ 'id ' => 2 ,
109
+ 'label ' => array (
110
+ 'name ' => 'Second label ' ,
111
+ 'color ' => '#F0AD4E ' ,
112
+ 'description ' => null
113
+ ),
114
+ 'position ' => 2
115
+ )
116
+ );
117
+
118
+ $ api = $ this ->getApiMock ();
119
+ $ api ->expects ($ this ->once ())
120
+ ->method ('get ' )
121
+ ->with ('projects/1/boards/2/lists ' )
122
+ ->will ($ this ->returnValue ($ expectedArray ))
123
+ ;
124
+
125
+ $ this ->assertEquals ($ expectedArray , $ api ->allLists (1 , 2 ));
126
+ }
127
+
128
+ /**
129
+ * @test
130
+ */
131
+ public function shouldGetList ()
132
+ {
133
+ $ expectedArray = array (
134
+ array (
135
+ 'id ' => 3 ,
136
+ 'label ' => array (
137
+ 'name ' => 'Some label ' ,
138
+ 'color ' => '#F0AD4E ' ,
139
+ 'description ' => null
140
+ ),
141
+ 'position ' => 3
142
+ )
143
+ );
144
+
145
+ $ api = $ this ->getApiMock ();
146
+ $ api ->expects ($ this ->once ())
147
+ ->method ('get ' )
148
+ ->with ('projects/1/boards/2/lists/3 ' )
149
+ ->will ($ this ->returnValue ($ expectedArray ))
150
+ ;
151
+
152
+ $ this ->assertEquals ($ expectedArray , $ api ->showList (1 , 2 , 3 ));
153
+ }
154
+
155
+ /**
156
+ * @test
157
+ */
158
+ public function shouldCreateList ()
159
+ {
160
+ $ expectedArray = array (
161
+ array (
162
+ 'id ' => 3 ,
163
+ 'label ' => array (
164
+ 'name ' => 'Some label ' ,
165
+ 'color ' => '#F0AD4E ' ,
166
+ 'description ' => null
167
+ ),
168
+ 'position ' => 3
169
+ )
170
+ );
171
+
172
+ $ api = $ this ->getApiMock ();
173
+ $ api ->expects ($ this ->once ())
174
+ ->method ('post ' )
175
+ ->with ('projects/1/boards/2/lists ' , array ('label_id ' => 4 ))
176
+ ->will ($ this ->returnValue ($ expectedArray ))
177
+ ;
178
+
179
+ $ this ->assertEquals ($ expectedArray , $ api ->createList (1 , 2 , 4 ));
180
+ }
181
+
182
+ /**
183
+ * @test
184
+ */
185
+ public function shouldUpdateList ()
186
+ {
187
+ $ expectedArray = array (
188
+ array (
189
+ 'id ' => 3 ,
190
+ 'label ' => array (
191
+ 'name ' => 'Some label ' ,
192
+ 'color ' => '#F0AD4E ' ,
193
+ 'description ' => null
194
+ ),
195
+ 'position ' => 1
196
+ )
197
+ );
198
+
199
+ $ api = $ this ->getApiMock ();
200
+ $ api ->expects ($ this ->once ())
201
+ ->method ('put ' )
202
+ ->with ('projects/5/boards/2/lists/3 ' , array ('position ' => 1 ))
203
+ ->will ($ this ->returnValue ($ expectedArray ))
204
+ ;
205
+
206
+ $ this ->assertEquals ($ expectedArray , $ api ->updateList (5 , 2 , 3 , 1 ));
207
+ }
208
+
209
+ /**
210
+ * @test
211
+ */
212
+ public function shouldDeleteList ()
213
+ {
214
+ $ expectedBool = true ;
215
+
216
+ $ api = $ this ->getApiMock ();
217
+ $ api ->expects ($ this ->once ())
218
+ ->method ('delete ' )
219
+ ->with ('projects/1/boards/2/lists/3 ' )
220
+ ->will ($ this ->returnValue ($ expectedBool ))
221
+ ;
222
+
223
+ $ this ->assertEquals ($ expectedBool , $ api ->deleteList (1 , 2 , 3 ));
224
+ }
204
225
205
226
protected function getApiClass ()
206
227
{
0 commit comments