/**
  * @param JsonCoder $jsonCoder
  * @return Raml\DocNavigator
  */
 public function createNavigator(JsonCoder $jsonCoder)
 {
     $ramlDocPath = $this->kernel->getRootDir() . static::RAML_DOC_PATH;
     if (!is_readable($ramlDocPath)) {
         throw new \RuntimeException(static::ERROR_PARAM_TYPE);
     }
     $ramlDoc = $this->parser->parse($ramlDocPath);
     return new Raml\DocNavigator($ramlDoc, $jsonCoder);
 }
예제 #2
0
 public function testParsingRamlDoc()
 {
     /* Given... (Fixture) */
     $mapCollectionParser = Stub::makeEmpty('GoIntegro\\Raml\\MapCollectionParser');
     $docExpander = Stub::makeEmpty('GoIntegro\\Raml\\DocExpander');
     $parser = new DocParser($mapCollectionParser, $docExpander);
     /* When... (Action) */
     $ramlDoc = $parser->parse(__DIR__ . self::RAML_PATH);
     /* Then... (Assertions) */
     $this->assertInstanceOf('GoIntegro\\Raml\\RamlDoc', $ramlDoc);
 }