@@ -143,12 +143,44 @@ public function shouldMergePullRequest()
143
143
$ api = $ this ->getApiMock ();
144
144
$ api ->expects ($ this ->once ())
145
145
->method ('put ' )
146
- ->with ('/repos/ezsystems/ezpublish/pulls/15/merge ' , array ('commit_message ' => 'Merged something ' , 'sha ' => str_repeat ('A ' , 40 ), 'squash ' => false ))
146
+ ->with ('/repos/ezsystems/ezpublish/pulls/15/merge ' , array ('commit_message ' => 'Merged something ' , 'sha ' => str_repeat ('A ' , 40 ), 'merge_method ' => ' merge ' ))
147
147
->will ($ this ->returnValue ($ expectedArray ));
148
148
149
149
$ this ->assertEquals ($ expectedArray , $ api ->merge ('ezsystems ' , 'ezpublish ' , 15 , 'Merged something ' , str_repeat ('A ' , 40 )));
150
150
}
151
151
152
+ /**
153
+ * @test
154
+ */
155
+ public function shouldMergePullRequestWithSquashAsBool ()
156
+ {
157
+ $ expectedArray = array ('some ' => 'response ' );
158
+
159
+ $ api = $ this ->getApiMock ();
160
+ $ api ->expects ($ this ->once ())
161
+ ->method ('put ' )
162
+ ->with ('/repos/ezsystems/ezpublish/pulls/15/merge ' , array ('commit_message ' => 'Merged something ' , 'sha ' => str_repeat ('A ' , 40 ), 'merge_method ' => 'squash ' ))
163
+ ->will ($ this ->returnValue ($ expectedArray ));
164
+
165
+ $ this ->assertEquals ($ expectedArray , $ api ->merge ('ezsystems ' , 'ezpublish ' , 15 , 'Merged something ' , str_repeat ('A ' , 40 ), true ));
166
+ }
167
+
168
+ /**
169
+ * @test
170
+ */
171
+ public function shouldMergePullRequestWithMergeMethod ()
172
+ {
173
+ $ expectedArray = array ('some ' => 'response ' );
174
+
175
+ $ api = $ this ->getApiMock ();
176
+ $ api ->expects ($ this ->once ())
177
+ ->method ('put ' )
178
+ ->with ('/repos/ezsystems/ezpublish/pulls/15/merge ' , array ('commit_message ' => 'Merged something ' , 'sha ' => str_repeat ('A ' , 40 ), 'merge_method ' => 'rebase ' ))
179
+ ->will ($ this ->returnValue ($ expectedArray ));
180
+
181
+ $ this ->assertEquals ($ expectedArray , $ api ->merge ('ezsystems ' , 'ezpublish ' , 15 , 'Merged something ' , str_repeat ('A ' , 40 ), 'rebase ' ));
182
+ }
183
+
152
184
/**
153
185
* @test
154
186
*/
0 commit comments