File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -17,4 +17,13 @@ public function all(array $parameters = [])
1717
1818 return $ this ->get ('namespaces ' , $ resolver ->resolve ($ parameters ));
1919 }
20+
21+ /**
22+ * @param integer|string $namespace_id
23+ * @return mixed
24+ */
25+ public function show ($ namespace_id )
26+ {
27+ return $ this ->get ('namespaces/ ' .$ this ->encodePath ($ namespace_id ));
28+ }
2029}
Original file line number Diff line number Diff line change @@ -24,6 +24,23 @@ public function shouldGetAllNamespaces()
2424 $ this ->assertEquals ($ expectedArray , $ api ->all ());
2525 }
2626
27+ /**
28+ * @test
29+ */
30+ public function shouldShowNamespace ()
31+ {
32+ $ expectedArray = array ('id ' => 1 , 'name ' => 'internal ' );
33+
34+ $ api = $ this ->getApiMock ();
35+ $ api ->expects ($ this ->once ())
36+ ->method ('get ' )
37+ ->with ('namespaces/1 ' )
38+ ->will ($ this ->returnValue ($ expectedArray ))
39+ ;
40+
41+ $ this ->assertEquals ($ expectedArray , $ api ->show (1 ));
42+ }
43+
2744 protected function getApiClass ()
2845 {
2946 return 'Gitlab\Api\ProjectNamespaces ' ;
You can’t perform that action at this time.
0 commit comments