Skip to content

Commit 9c64e60

Browse files
committed
Fix tests
1 parent 1b1042f commit 9c64e60

File tree

2 files changed

+33
-6
lines changed

2 files changed

+33
-6
lines changed

test/Github/Tests/Api/PullRequestTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,15 @@ public function shouldShowFilesFromPullRequest()
106106
*/
107107
public function shouldUpdatePullRequests()
108108
{
109-
$expectedArray = array('id' => 'id', 'sha' => '123123');
109+
$expectedArray = array('id' => 15, 'sha' => '123123');
110110

111111
$api = $this->getApiMock();
112112
$api->expects($this->once())
113113
->method('patch')
114-
->with('repos/ezsystems/ezpublish/pulls', array('state' => 'open', 'some' => 'param'))
114+
->with('repos/ezsystems/ezpublish/pulls/15', array('state' => 'open', 'some' => 'param'))
115115
->will($this->returnValue($expectedArray));
116116

117-
$this->assertEquals($expectedArray, $api->update('ezsystems', 'ezpublish', array('state' => 'aa', 'some' => 'param')));
117+
$this->assertEquals($expectedArray, $api->update('ezsystems', 'ezpublish', 15, array('state' => 'aa', 'some' => 'param')));
118118
}
119119

120120
/**

test/Github/Tests/Api/RepoTest.php

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,16 @@ public function shouldCreateRepositoryUsingNameOnly()
6868
$api = $this->getApiMock();
6969
$api->expects($this->once())
7070
->method('post')
71-
->with('user/repos', array('name' => 'l3l0Repo', 'description' => '', 'homepage' => '', 'private' => false))
71+
->with('user/repos', array(
72+
'name' => 'l3l0Repo',
73+
'description' => '',
74+
'homepage' => '',
75+
'private' => false,
76+
'has_issues' => false,
77+
'has_wiki' => false,
78+
'has_downloads' => false,
79+
'auto_init' => false
80+
))
7281
->will($this->returnValue($expectedArray));
7382

7483
$this->assertEquals($expectedArray, $api->create('l3l0Repo'));
@@ -84,7 +93,16 @@ public function shouldCreateRepositoryForOrganization()
8493
$api = $this->getApiMock();
8594
$api->expects($this->once())
8695
->method('post')
87-
->with('orgs/KnpLabs/repos', array('name' => 'KnpLabsRepo', 'description' => '', 'homepage' => '', 'private' => false))
96+
->with('orgs/KnpLabs/repos', array(
97+
'name' => 'KnpLabsRepo',
98+
'description' => '',
99+
'homepage' => '',
100+
'private' => false,
101+
'has_issues' => false,
102+
'has_wiki' => false,
103+
'has_downloads' => false,
104+
'auto_init' => false
105+
))
88106
->will($this->returnValue($expectedArray));
89107

90108
$this->assertEquals($expectedArray, $api->create('KnpLabsRepo', '', '', true, 'KnpLabs'));
@@ -228,7 +246,16 @@ public function shouldCreateUsingAllParams()
228246
$api = $this->getApiMock();
229247
$api->expects($this->once())
230248
->method('post')
231-
->with('user/repos', array('name' => 'l3l0Repo', 'description' => 'test', 'homepage' => 'http://l3l0.eu', 'private' => true))
249+
->with('user/repos', array(
250+
'name' => 'l3l0Repo',
251+
'description' => 'test',
252+
'homepage' => 'http://l3l0.eu',
253+
'private' => true,
254+
'has_issues' => false,
255+
'has_wiki' => false,
256+
'has_downloads' => false,
257+
'auto_init' => false
258+
))
232259
->will($this->returnValue($expectedArray));
233260

234261
$this->assertEquals($expectedArray, $api->create('l3l0Repo', 'test', 'http://l3l0.eu', false));

0 commit comments

Comments
 (0)