private function runGeneratedModelTest($modelName, $modelFile)
 {
     $expected = file_get_contents(__DIR__ . '/model_data/' . $modelFile);
     $parsed = ParsedResult::getSampleParsedObject();
     $models = $parsed['modelList']->all();
     $model = $models[$modelName];
     if (is_null($this->modelGenerator)) {
         $this->modelGenerator = new ModelGenerator();
     }
     $this->assertEquals($expected, $this->modelGenerator->generate($model));
 }
示例#2
0
 /**
  * Generates all the models, given a list of models
  * @param  array $models An array of model objects
  */
 protected function generateModels($models)
 {
     foreach ($models as $model) {
         $this->larryWriter->writeModel($this->modelGenerator->generate($model), $model->modelName . '.php');
         $this->info("Wrote model: " . $model->modelName . '.php');
     }
 }