public function testEntity()
 {
     $class = Fixtures::createEntity();
     $generator = new CodeFileGenerator(['generateDocblock' => true, 'generateEmptyDocblock' => false]);
     $code = $generator->generate($class);
     $this->assertEquals($this->getFixtureContent('Entity.php'), $code);
 }
 public function testABClass()
 {
     $class = Fixtures::createABClass();
     $modelGenerator = new ModelGenerator();
     $modelCode = $modelGenerator->generate($class);
     $this->assertEquals($this->getGeneratedContent('ABClass.php'), $modelCode);
     $generator = new CodeGenerator(['generateDocblock' => false]);
     $code = $generator->generate($class);
     $this->assertEquals($modelCode, $code);
     $modelGenerator = new ModelGenerator(['generateDocblock' => true]);
     $modelCode = $modelGenerator->generate($class);
     $this->assertEquals($this->getGeneratedContent('ABClassWithComments.php'), $modelCode);
     $generator = new CodeGenerator(['generateDocblock' => true]);
     $code = $generator->generate($class);
     $this->assertEquals($modelCode, $code);
 }
 public function testDummyInterface()
 {
     $expected = Fixtures::createDummyInterface();
     $actual = PhpInterface::fromFile(__DIR__ . '/../fixtures/DummyInterface.php');
     $this->assertEquals($expected, $actual);
 }
 public function testFromFile()
 {
     $expected = Fixtures::createDummyTrait();
     $actual = PhpTrait::fromFile(__DIR__ . '/../fixtures/DummyTrait.php');
     $this->assertEquals($expected, $actual);
 }
 public function testFromReflection()
 {
     $class = Fixtures::createEntity();
     $this->assertEquals($class, PhpClass::fromReflection(new \ReflectionClass('gossi\\codegen\\tests\\fixtures\\Entity')));
 }