@@ -142,6 +142,23 @@ public function testCreateCustomPackage($customJson)
142142 $ this ->assertSame ($ expected , $ api ->createCustomPackage ($ customJson ));
143143 }
144144
145+ public function testCreateArtifactPackage ()
146+ {
147+ $ expected = [
148+ 'id ' => 'job-id ' ,
149+ 'status ' => 'queued ' ,
150+ ];
151+
152+ /** @var Packages&\PHPUnit_Framework_MockObject_MockObject $api */
153+ $ api = $ this ->getApiMock ();
154+ $ api ->expects ($ this ->once ())
155+ ->method ('post ' )
156+ ->with ($ this ->equalTo ('/packages/ ' ), $ this ->equalTo (['repoType ' => 'artifact ' , 'artifactIds ' => [42 ]]))
157+ ->willReturn ($ expected );
158+
159+ $ this ->assertSame ($ expected , $ api ->createArtifactPackage ([42 ]));
160+ }
161+
145162 public function customProvider ()
146163 {
147164 return [
@@ -184,6 +201,23 @@ public function testEditCustomPackage()
184201 $ this ->assertSame ($ expected , $ api ->editCustomPackage ('acme-website/package ' , '{} ' ));
185202 }
186203
204+ public function testEditArtifactPackage ()
205+ {
206+ $ expected = [
207+ 'id ' => 'job-id ' ,
208+ 'status ' => 'queued ' ,
209+ ];
210+
211+ /** @var Packages&\PHPUnit_Framework_MockObject_MockObject $api */
212+ $ api = $ this ->getApiMock ();
213+ $ api ->expects ($ this ->once ())
214+ ->method ('put ' )
215+ ->with ($ this ->equalTo ('/packages/acme-website/package/ ' ), $ this ->equalTo (['repoType ' => 'artifact ' , 'artifactIds ' => [1 , 3 ]]))
216+ ->willReturn ($ expected );
217+
218+ $ this ->assertSame ($ expected , $ api ->editArtifactPackage ('acme-website/package ' , [1 , 3 ]));
219+ }
220+
187221 public function testRemove ()
188222 {
189223 $ expected = [];
0 commit comments