function testMultipleParams()
 {
     $lister = new ApiLister();
     $api = $lister->processAPI(new Apis\MultipleParamsApi());
     $this->assertEquals("/api/v2/:currency", $api['endpoint']);
     $this->assertEquals("An advanced test API.", $api['title']);
     $this->assertEquals("This is an extended description.\nIt spans multiple lines.", $api['description']);
     $this->assertEquals(array('currency' => "the currency to use", 'foo' => "another parameter", 'bar' => "another parameter across multiple lines"), $api['params']);
 }
Exemple #2
0
 function getJSON($arguments)
 {
     $lister = new ApiLister();
     $result = $lister->processAPIs($this->getAPIs());
     $json = array();
     foreach ($result as $api) {
         $json[] = array('endpoint' => $api['endpoint'], 'title' => $api['title'], 'description' => $api['description'], 'params' => $api['params']);
     }
     return $json;
 }
Exemple #3
0
 function testParamsMultipleLines()
 {
     $lister = new ApiLister();
     $this->assertEquals(array("hello world", "@param one across multiple lines", "@param two across multiple lines", "another line"), $lister->getLines("/**\n * hello\n * world\n *\n * @param one across\n *            multiple lines\n * @param two\n *    across multiple\n *    lines\n *\n * another\n * line\n */"));
 }