@@ -111,7 +111,7 @@ public function shouldCreateGroup()
111111 $ api = $ this ->getApiMock ();
112112 $ api ->expects ($ this ->once ())
113113 ->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 ' ))
115115 ->will ($ this ->returnValue ($ expectedArray ))
116116 ;
117117
@@ -121,17 +121,34 @@ public function shouldCreateGroup()
121121 /**
122122 * @test
123123 */
124- public function shouldCreateGroupWithDescriptionAndVisibility ()
124+ public function shouldCreateGroupWithDescriptionVisibilityAndParentId ()
125125 {
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 );
127127
128128 $ api = $ this ->getApiMock ();
129129 $ api ->expects ($ this ->once ())
130130 ->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 ))
132132 ->will ($ this ->returnValue ($ expectedArray ))
133133 ;
134134
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+
135152 $ this ->assertEquals ($ expectedArray , $ api ->create ('A new group ' , 'a-new-group ' , 'Description ' , 'public ' ));
136153 }
137154
0 commit comments