Example #1
0
 /**
  * @param Generator $modelGenerator
  * @param $fileName
  * @throws GeneratorException
  */
 private function saveClassToFile($modelGenerator, $fileName)
 {
     $outputOnly = $this->input->getOption('output-only');
     if ($fileName && !$outputOnly) {
         $this->output->writeln("Saving class to file: '{$fileName}'");
         $modelGenerator->saveToFile($fileName);
     }
 }
Example #2
0
 /**
  * @test
  */
 public function shouldGetCorrectNamespace()
 {
     //given
     $generator = new Generator('products');
     //when
     $namespace = $generator->getClassNamespace();
     //then
     $this->assertEquals('Application\\Model', $namespace);
 }