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 = [])
17
17
18
18
return $ this ->get ('namespaces ' , $ resolver ->resolve ($ parameters ));
19
19
}
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
+ }
20
29
}
Original file line number Diff line number Diff line change @@ -24,6 +24,23 @@ public function shouldGetAllNamespaces()
24
24
$ this ->assertEquals ($ expectedArray , $ api ->all ());
25
25
}
26
26
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
+
27
44
protected function getApiClass ()
28
45
{
29
46
return 'Gitlab\Api\ProjectNamespaces ' ;
You can’t perform that action at this time.
0 commit comments