File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
tests/TestCase/Webservice Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,8 @@ public function describe($endpoint)
165165 $ shortName = App::shortName (get_class ($ this ), 'Webservice ' , 'Webservice ' );
166166 list ($ plugin , $ name ) = pluginSplit ($ shortName );
167167
168- $ schemaShortName = implode ('. ' , array_filter ([$ plugin , Inflector::classify ($ endpoint )]));
168+ $ endpoint = Inflector::classify (str_replace ('- ' , '_ ' , $ endpoint ));
169+ $ schemaShortName = implode ('. ' , array_filter ([$ plugin , $ endpoint ]));
169170 $ schemaClassName = App::className ($ schemaShortName , 'Model/Endpoint/Schema ' , 'Schema ' );
170171 if ($ schemaClassName ) {
171172 return new $ schemaClassName ($ endpoint );
Original file line number Diff line number Diff line change @@ -200,6 +200,15 @@ public function testTransformResults()
200200 $ this ->assertInstanceOf ('\Muffin\Webservice\Model\Resource ' , $ resources [0 ]);
201201 }
202202
203+ public function testDescribe ()
204+ {
205+ $ service = new TestWebservice ();
206+
207+ $ result = $ service ->describe ('test ' );
208+ $ this ->assertInstanceOf ('\Muffin\Webservice\Model\Schema ' , $ result );
209+ $ this ->assertEquals ('Test ' , $ result ->name ());
210+ }
211+
203212 public function testDebugInfo ()
204213 {
205214 $ this ->assertEquals ([
You can’t perform that action at this time.
0 commit comments