@@ -95,7 +95,7 @@ public function shouldCreateRepositoryUsingNameOnly()
95
95
'name ' => 'l3l0Repo ' ,
96
96
'description ' => '' ,
97
97
'homepage ' => '' ,
98
- 'private ' => false ,
98
+ 'visibility ' => ' public ' ,
99
99
'has_issues ' => false ,
100
100
'has_wiki ' => false ,
101
101
'has_downloads ' => false ,
@@ -121,7 +121,7 @@ public function shouldCreateRepositoryForOrganization()
121
121
'name ' => 'KnpLabsRepo ' ,
122
122
'description ' => '' ,
123
123
'homepage ' => '' ,
124
- 'private ' => false ,
124
+ 'visibility ' => ' public ' ,
125
125
'has_issues ' => false ,
126
126
'has_wiki ' => false ,
127
127
'has_downloads ' => false ,
@@ -133,6 +133,48 @@ public function shouldCreateRepositoryForOrganization()
133
133
$ this ->assertEquals ($ expectedArray , $ api ->create ('KnpLabsRepo ' , '' , '' , true , 'KnpLabs ' ));
134
134
}
135
135
136
+ /**
137
+ * @test
138
+ */
139
+ public function shouldCreateRepositoryWithInternalVisibility ()
140
+ {
141
+ $ expectedArray = ['id ' => 1 , 'name ' => 'KnpLabsRepo ' ];
142
+
143
+ $ api = $ this ->getApiMock ();
144
+ $ api ->expects ($ this ->once ())
145
+ ->method ('post ' )
146
+ ->with ('/user/repos ' , [
147
+ 'name ' => 'KnpLabsRepo ' ,
148
+ 'description ' => '' ,
149
+ 'homepage ' => '' ,
150
+ 'has_issues ' => false ,
151
+ 'has_wiki ' => false ,
152
+ 'has_downloads ' => false ,
153
+ 'auto_init ' => false ,
154
+ 'has_projects ' => true ,
155
+ 'visibility ' => 'internal ' ,
156
+ ])
157
+ ->will ($ this ->returnValue ($ expectedArray ));
158
+
159
+ $ this ->assertEquals (
160
+ $ expectedArray ,
161
+ $ api ->create (
162
+ 'KnpLabsRepo ' ,
163
+ '' ,
164
+ '' ,
165
+ false ,
166
+ null ,
167
+ false ,
168
+ false ,
169
+ false ,
170
+ null ,
171
+ false ,
172
+ true ,
173
+ 'internal '
174
+ )
175
+ );
176
+ }
177
+
136
178
/**
137
179
* @test
138
180
*/
@@ -329,7 +371,7 @@ public function shouldCreateUsingAllParams()
329
371
'name ' => 'l3l0Repo ' ,
330
372
'description ' => 'test ' ,
331
373
'homepage ' => 'http://l3l0.eu ' ,
332
- 'private ' => true ,
374
+ 'visibility ' => ' private ' ,
333
375
'has_issues ' => false ,
334
376
'has_wiki ' => false ,
335
377
'has_downloads ' => false ,
0 commit comments