@@ -49,19 +49,48 @@ public function testCreate()
4949 'id ' => 1 ,
5050 'type ' => 'composer-repo ' ,
5151 'name ' => $ name = 'Customer ' ,
52+ 'accessToVersionControlSource ' => false ,
5253 ],
5354 ];
5455
5556 /** @var Customers&\PHPUnit_Framework_MockObject_MockObject $api */
5657 $ api = $ this ->getApiMock ();
5758 $ api ->expects ($ this ->once ())
5859 ->method ('post ' )
59- ->with ($ this ->equalTo ('/customers/ ' ), $ this ->equalTo (['name ' => $ name ]))
60+ ->with ($ this ->equalTo ('/customers/ ' ), $ this ->equalTo (['name ' => $ name, ' accessToVersionControlSource ' => false ]))
6061 ->will ($ this ->returnValue ($ expected ));
6162
6263 $ this ->assertSame ($ expected , $ api ->create ($ name ));
6364 }
6465
66+ public function testUpdate ()
67+ {
68+ $ expected = [
69+ [
70+ 'id ' => 1 ,
71+ 'type ' => 'composer-repo ' ,
72+ 'name ' => $ name = 'Customer ' ,
73+ 'urlName ' => 'customer ' ,
74+ 'accessToVersionControlSource ' => false ,
75+ ],
76+ ];
77+
78+ $ customer = [
79+ 'name ' => $ name ,
80+ 'urlName ' => 'customer ' ,
81+ 'accessToVersionControlSource ' => false ,
82+ ];
83+
84+ /** @var Customers&\PHPUnit_Framework_MockObject_MockObject $api */
85+ $ api = $ this ->getApiMock ();
86+ $ api ->expects ($ this ->once ())
87+ ->method ('put ' )
88+ ->with ($ this ->equalTo ('/customers/1/ ' ), $ this ->equalTo ($ customer ))
89+ ->will ($ this ->returnValue ($ expected ));
90+
91+ $ this ->assertSame ($ expected , $ api ->update (1 , $ customer ));
92+ }
93+
6594 public function testRemove ()
6695 {
6796 $ expected = '' ;
0 commit comments