File tree 3 files changed +38
-0
lines changed
3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,12 @@ Returns a new job.
170
170
$client->packages()->remove('acme-website/package');
171
171
```
172
172
173
+ ##### List all customers with access to a package
174
+ ``` php
175
+ $client->packages()->listCustomers('acme-website/package');
176
+ ```
177
+ Returns a list of customers with access to the package.
178
+
173
179
#### Credential
174
180
175
181
##### List an organization's credentials
Original file line number Diff line number Diff line change @@ -60,4 +60,9 @@ public function remove($packageName)
60
60
{
61
61
return $ this ->delete (sprintf ('/packages/%s/ ' , $ packageName ));
62
62
}
63
+
64
+ public function listCustomers ($ packageName )
65
+ {
66
+ return $ this ->get (sprintf ('/packages/%s/customers/ ' , $ packageName ));
67
+ }
63
68
}
Original file line number Diff line number Diff line change @@ -162,6 +162,33 @@ public function testRemove()
162
162
$ this ->assertSame ($ expected , $ api ->remove ('acme-website/package ' ));
163
163
}
164
164
165
+ public function testListPackages ()
166
+ {
167
+ $ expected = [
168
+ [
169
+ 'package ' => [
170
+ 'name ' => 'composer/composer ' ,
171
+ 'origin ' => 'private ' ,
172
+ 'versionConstraint ' => null ,
173
+ 'expirationDate ' => null ,
174
+ ],
175
+ 'customer ' => [
176
+ 'id ' => 1 ,
177
+ 'name ' => 'Customer ' ,
178
+ ],
179
+ ]
180
+ ];
181
+
182
+ /** @var Customers&\PHPUnit_Framework_MockObject_MockObject $api */
183
+ $ api = $ this ->getApiMock ();
184
+ $ api ->expects ($ this ->once ())
185
+ ->method ('get ' )
186
+ ->with ($ this ->equalTo ('/packages/composer/composer/customers/ ' ))
187
+ ->will ($ this ->returnValue ($ expected ));
188
+
189
+ $ this ->assertSame ($ expected , $ api ->listCustomers ('composer/composer ' ));
190
+ }
191
+
165
192
protected function getApiClass ()
166
193
{
167
194
return Packages::class;
You can’t perform that action at this time.
0 commit comments