@@ -21,97 +21,74 @@ 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
- //
65
- // /**
66
- // * @test
67
- // */
68
- // public function shouldShowIssue()
69
- // {
70
- // $expectedArray = array('id' => 2, 'title' => 'Another issue');
71
- //
72
- // $api = $this->getApiMock();
73
- // $api->expects($this->once())
74
- // ->method('get')
75
- // ->with('projects/1/issues?iid=2')
76
- // ->will($this->returnValue($expectedArray))
77
- // ;
78
- //
79
- // $this->assertEquals($expectedArray, $api->show(1, 2));
80
- // }
81
- //
82
- // /**
83
- // * @test
84
- // */
85
- // public function shouldCreateIssue()
86
- // {
87
- // $expectedArray = array('id' => 3, 'title' => 'A new issue');
88
- //
89
- // $api = $this->getApiMock();
90
- // $api->expects($this->once())
91
- // ->method('post')
92
- // ->with('projects/1/issues', array('title' => 'A new issue', 'labels' => 'foo,bar'))
93
- // ->will($this->returnValue($expectedArray))
94
- // ;
95
- //
96
- // $this->assertEquals($expectedArray, $api->create(1, array('title' => 'A new issue', 'labels' => 'foo,bar')));
97
- // }
98
- //
99
- // /**
100
- // * @test
101
- // */
102
- // public function shouldUpdateIssue()
103
- // {
104
- // $expectedArray = array('id' => 2, 'title' => 'A renamed issue');
105
- //
106
- // $api = $this->getApiMock();
107
- // $api->expects($this->once())
108
- // ->method('put')
109
- // ->with('projects/1/issues/2', array('title' => 'A renamed issue', 'labels' => 'foo'))
110
- // ->will($this->returnValue($expectedArray))
111
- // ;
112
- //
113
- // $this->assertEquals($expectedArray, $api->update(1, 2, array('title' => 'A renamed issue', 'labels' => 'foo')));
114
- // }
24
+
25
+ /**
26
+ * @test
27
+ */
28
+ public function shouldShowIssueBoard ()
29
+ {
30
+ $ expectedArray = array ('id ' => 2 , 'name ' => 'Another issue board ' );
31
+
32
+ $ api = $ this ->getApiMock ();
33
+ $ api ->expects ($ this ->once ())
34
+ ->method ('get ' )
35
+ ->with ('projects/1/boards/2 ' )
36
+ ->will ($ this ->returnValue ($ expectedArray ))
37
+ ;
38
+
39
+ $ this ->assertEquals ($ expectedArray , $ api ->show (1 , 2 ));
40
+ }
41
+
42
+ /**
43
+ * @test
44
+ */
45
+ public function shouldCreateIssueBoard ()
46
+ {
47
+ $ expectedArray = array ('id ' => 3 , 'name ' => 'A new issue board ' );
48
+
49
+ $ api = $ this ->getApiMock ();
50
+ $ api ->expects ($ this ->once ())
51
+ ->method ('post ' )
52
+ ->with ('projects/1/boards ' , array ('name ' => 'A new issue board ' ))
53
+ ->will ($ this ->returnValue ($ expectedArray ))
54
+ ;
55
+
56
+ $ this ->assertEquals ($ expectedArray , $ api ->create (1 , array ('name ' => 'A new issue board ' )));
57
+ }
58
+
59
+ /**
60
+ * @test
61
+ */
62
+ public function shouldUpdateIssueBoard ()
63
+ {
64
+ $ expectedArray = array ('id ' => 2 , 'name ' => 'A renamed issue board ' );
65
+
66
+ $ api = $ this ->getApiMock ();
67
+ $ api ->expects ($ this ->once ())
68
+ ->method ('put ' )
69
+ ->with ('projects/1/boards/2 ' , array ('name ' => 'A renamed issue board ' , 'labels ' => 'foo ' ))
70
+ ->will ($ this ->returnValue ($ expectedArray ))
71
+ ;
72
+
73
+ $ this ->assertEquals ($ expectedArray , $ api ->update (1 , 2 , array ('name ' => 'A renamed issue board ' , 'labels ' => 'foo ' )));
74
+ }
75
+
76
+ /**
77
+ * @test
78
+ */
79
+ public function shouldRemoveIssueBoard ()
80
+ {
81
+ $ expectedBool = true ;
82
+
83
+ $ api = $ this ->getApiMock ();
84
+ $ api ->expects ($ this ->once ())
85
+ ->method ('delete ' )
86
+ ->with ('projects/1/boards/2 ' )
87
+ ->will ($ this ->returnValue ($ expectedBool ))
88
+ ;
89
+
90
+ $ this ->assertEquals ($ expectedBool , $ api ->remove (1 , 2 ));
91
+ }
115
92
116
93
/**
117
94
* @test
0 commit comments