@@ -49,19 +49,48 @@ public function testCreate()
49
49
'id ' => 1 ,
50
50
'type ' => 'composer-repo ' ,
51
51
'name ' => $ name = 'Customer ' ,
52
+ 'accessToVersionControlSource ' => false ,
52
53
],
53
54
];
54
55
55
56
/** @var Customers&\PHPUnit_Framework_MockObject_MockObject $api */
56
57
$ api = $ this ->getApiMock ();
57
58
$ api ->expects ($ this ->once ())
58
59
->method ('post ' )
59
- ->with ($ this ->equalTo ('/customers/ ' ), $ this ->equalTo (['name ' => $ name ]))
60
+ ->with ($ this ->equalTo ('/customers/ ' ), $ this ->equalTo (['name ' => $ name, ' accessToVersionControlSource ' => false ]))
60
61
->will ($ this ->returnValue ($ expected ));
61
62
62
63
$ this ->assertSame ($ expected , $ api ->create ($ name ));
63
64
}
64
65
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
+
65
94
public function testRemove ()
66
95
{
67
96
$ expected = '' ;
0 commit comments