@@ -39,6 +39,58 @@ public function testAll()
39
39
$ this ->assertSame ($ expected , $ api ->all ());
40
40
}
41
41
42
+ public function testPackages ()
43
+ {
44
+ $ expected = [
45
+ [
46
+ 'id ' => 1 ,
47
+ 'name ' => 'acme-website/package ' ,
48
+ ],
49
+ ];
50
+
51
+ /** @var Teams&\PHPUnit_Framework_MockObject_MockObject $api */
52
+ $ api = $ this ->getApiMock ();
53
+ $ api ->expects ($ this ->once ())
54
+ ->method ('get ' )
55
+ ->with ($ this ->equalTo ('/teams/1/packages/ ' ))
56
+ ->willReturn ($ expected );
57
+
58
+ $ this ->assertSame ($ expected , $ api ->packages (1 ));
59
+ }
60
+
61
+ public function testAddPackages ()
62
+ {
63
+ $ expected = [
64
+ [
65
+ 'id ' => 1 ,
66
+ 'name ' => 'acme-website/package ' ,
67
+ ],
68
+ ];
69
+
70
+ /** @var Teams&\PHPUnit_Framework_MockObject_MockObject $api */
71
+ $ api = $ this ->getApiMock ();
72
+ $ api ->expects ($ this ->once ())
73
+ ->method ('post ' )
74
+ ->with ($ this ->equalTo ('/teams/1/packages/ ' ), $ this ->equalTo (['acme-website/package ' ]))
75
+ ->willReturn ($ expected );
76
+
77
+ $ this ->assertSame ($ expected , $ api ->addPackages (1 , ['acme-website/package ' ]));
78
+ }
79
+
80
+ public function testRemovePackage ()
81
+ {
82
+ $ expected = [];
83
+
84
+ /** @var Teams&\PHPUnit_Framework_MockObject_MockObject $api */
85
+ $ api = $ this ->getApiMock ();
86
+ $ api ->expects ($ this ->once ())
87
+ ->method ('delete ' )
88
+ ->with ($ this ->equalTo ('/teams/1/packages/acme-website/package/ ' ))
89
+ ->willReturn ($ expected );
90
+
91
+ $ this ->assertSame ($ expected , $ api ->removePackage (1 , 'acme-website/package ' ));
92
+ }
93
+
42
94
/**
43
95
* @return string
44
96
*/
0 commit comments