File tree 3 files changed +58
-0
lines changed
3 files changed +58
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace PrivatePackagist \ApiClient \Api ;
4
+
5
+ class Synchronizations extends AbstractApi
6
+ {
7
+ public function all ()
8
+ {
9
+ return $ this ->get ('/synchronizations/ ' );
10
+ }
11
+ }
Original file line number Diff line number Diff line change @@ -112,6 +112,11 @@ public function tokens()
112
112
return new Api \Tokens ($ this , $ this ->responseMediator );
113
113
}
114
114
115
+ public function synchronizations ()
116
+ {
117
+ return new Api \Synchronizations ($ this , $ this ->responseMediator );
118
+ }
119
+
115
120
public function getHttpClient ()
116
121
{
117
122
return $ this ->getHttpClientBuilder ()->getHttpClient ();
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ namespace PrivatePackagist \ApiClient \Api ;
4
+
5
+ use PHPUnit \Framework \MockObject \MockObject ;
6
+
7
+ class SynchronizationsTest extends ApiTestCase
8
+ {
9
+ public function testAll ()
10
+ {
11
+ $ expected = [
12
+ [
13
+ "id " => 42 ,
14
+ "name " => "Acme Organization " ,
15
+ "isPrimary " => true ,
16
+ "integration " => [
17
+ "name " => "GitHub " ,
18
+ "target " => "github " ,
19
+ "url " => "https://github.com "
20
+ ],
21
+ "credentials " => 432 ,
22
+ ]
23
+ ];
24
+
25
+ /** @var Synchronizations&MockObject $api */
26
+ $ api = $ this ->getApiMock ();
27
+ $ api ->expects ($ this ->once ())
28
+ ->method ('get ' )
29
+ ->with ($ this ->equalTo ('/synchronizations/ ' ))
30
+ ->willReturn ($ expected );
31
+
32
+ $ this ->assertSame ($ expected , $ api ->all ());
33
+ }
34
+
35
+ /**
36
+ * @return string
37
+ */
38
+ protected function getApiClass ()
39
+ {
40
+ return Synchronizations::class;
41
+ }
42
+ }
You can’t perform that action at this time.
0 commit comments