/**
  * @dataProvider resourceProvider
  */
 public function testRessources($expected, $swaggerSpec, $name)
 {
     $swagger = JaneSwagger::build();
     $printer = new Standard();
     $files = $swagger->generate($swaggerSpec, 'Joli\\Jane\\Swagger\\Tests\\Expected', 'dummy');
     // Resource + NormalizerFactory
     $this->assertCount(2, $files);
     $resource = $files[1];
     $this->assertEquals($resource->getFilename(), 'dummy/Resource/TestResource.php');
     $this->assertEquals(trim($expected), trim($printer->prettyPrintFile([$resource->getNode()])));
 }
Esempio n. 2
0
<?php

require __DIR__ . '/vendor/autoload.php';
$janeSwagger = \Joli\Jane\Swagger\JaneSwagger::build();
$files = $janeSwagger->generate(__DIR__ . '/docker-swagger.json', 'Docker\\API', __DIR__ . '/generated');
$janeSwagger->printFiles($files, __DIR__ . '/generated');