@@ -111,7 +111,7 @@ public function shouldCreateGroup()
111
111
$ api = $ this ->getApiMock ();
112
112
$ api ->expects ($ this ->once ())
113
113
->method ('post ' )
114
- ->with ('groups ' , array ('name ' => 'A new group ' , 'path ' => 'a-new-group ' , 'description ' => null , ' visibility ' => 'private ' ))
114
+ ->with ('groups ' , array ('name ' => 'A new group ' , 'path ' => 'a-new-group ' , 'visibility ' => 'private ' ))
115
115
->will ($ this ->returnValue ($ expectedArray ))
116
116
;
117
117
@@ -121,17 +121,34 @@ public function shouldCreateGroup()
121
121
/**
122
122
* @test
123
123
*/
124
- public function shouldCreateGroupWithDescriptionAndVisibility ()
124
+ public function shouldCreateGroupWithDescriptionVisibilityAndParentId ()
125
125
{
126
- $ expectedArray = array ('id ' => 1 , 'name ' => 'A new group ' , 'visibility_level ' => 2 );
126
+ $ expectedArray = array ('id ' => 1 , 'name ' => 'A new group ' , 'visibility_level ' => 2 , ' parent_id ' => 666 );
127
127
128
128
$ api = $ this ->getApiMock ();
129
129
$ api ->expects ($ this ->once ())
130
130
->method ('post ' )
131
- ->with ('groups ' , array ('name ' => 'A new group ' , 'path ' => 'a-new-group ' , 'description ' => 'Description ' , 'visibility ' => 'public ' ))
131
+ ->with ('groups ' , array ('name ' => 'A new group ' , 'path ' => 'a-new-group ' , 'description ' => 'Description ' , 'visibility ' => 'public ' , ' parent_id ' => 666 ))
132
132
->will ($ this ->returnValue ($ expectedArray ))
133
133
;
134
134
135
+ $ this ->assertEquals ($ expectedArray , $ api ->create ('A new group ' , 'a-new-group ' , 'Description ' , 'public ' , null , null , 666 ));
136
+ }
137
+
138
+ /**
139
+ * @test
140
+ */
141
+ public function shouldCreateGroupWithDescriptionAndVisibility ()
142
+ {
143
+ $ expectedArray = array ('id ' => 1 , 'name ' => 'A new group ' , 'visibility_level ' => 2 );
144
+
145
+ $ api = $ this ->getApiMock ();
146
+ $ api ->expects ($ this ->once ())
147
+ ->method ('post ' )
148
+ ->with ('groups ' , array ('name ' => 'A new group ' , 'path ' => 'a-new-group ' , 'description ' => 'Description ' , 'visibility ' => 'public ' ))
149
+ ->will ($ this ->returnValue ($ expectedArray ))
150
+ ;
151
+
135
152
$ this ->assertEquals ($ expectedArray , $ api ->create ('A new group ' , 'a-new-group ' , 'Description ' , 'public ' ));
136
153
}
137
154
0 commit comments