File tree 4 files changed +52
-1
lines changed
4 files changed +52
-1
lines changed Original file line number Diff line number Diff line change @@ -38,8 +38,9 @@ Full documentation can be found in the [Private Packagist documentation](https:/
38
38
39
39
##### Trigger a full synchronization
40
40
``` php
41
- $client->organization()->sync();
41
+ $jobs = $ client->organization()->sync();
42
42
```
43
+ Returns an array of created jobs. One for every synchronization.
43
44
44
45
#### Customer
45
46
@@ -116,6 +117,14 @@ $packages = $client->packages()->all($filters);
116
117
```
117
118
Returns an array of packages.
118
119
120
+ #### Job
121
+
122
+ ##### Show a job
123
+ ``` php
124
+ $job = $client->jobs()->show($jobId);
125
+ ```
126
+ Returns the job.
127
+
119
128
## License
120
129
121
130
` private-packagist/api-client ` is licensed under the MIT License
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace PrivatePackagist \ApiClient \Api ;
4
+
5
+ class Jobs extends AbstractApi
6
+ {
7
+ public function show ($ jobId )
8
+ {
9
+ return $ this ->get (sprintf ('/jobs/%s ' , $ jobId ));
10
+ }
11
+ }
Original file line number Diff line number Diff line change @@ -58,6 +58,11 @@ public function packages()
58
58
return new Api \Packages ($ this , $ this ->responseMediator );
59
59
}
60
60
61
+ public function jobs ()
62
+ {
63
+ return new Api \Jobs ($ this , $ this ->responseMediator );
64
+ }
65
+
61
66
public function getHttpClient ()
62
67
{
63
68
return $ this ->getHttpClientBuilder ()->getHttpClient ();
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace PrivatePackagist \ApiClient \Api ;
4
+
5
+ class JobsTest extends ApiTestCase
6
+ {
7
+ public function testShow ()
8
+ {
9
+ $ expected = [];
10
+ $ jobId = '46bf13150a86fece079ca979cb8ef57c78773faa ' ;
11
+
12
+ /** @var Jobs&\PHPUnit_Framework_MockObject_MockObject $api */
13
+ $ api = $ this ->getApiMock ();
14
+ $ api ->expects ($ this ->once ())
15
+ ->method ('get ' )
16
+ ->with ($ this ->equalTo ('/jobs/ ' . $ jobId ))
17
+ ->will ($ this ->returnValue ($ expected ));
18
+
19
+ $ this ->assertSame ($ expected , $ api ->show ($ jobId ));
20
+ }
21
+
22
+ protected function getApiClass ()
23
+ {
24
+ return Jobs::class;
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments