public function testParseTraitToString() { $code = new PhpClass(); $code->setName('Test')->setDescription('Class description')->setIsTrait()->addMethod(new Method()); $expected = '<?php' . PHP_EOL . '' . PHP_EOL . '/**' . PHP_EOL . ' * Class description' . PHP_EOL . ' */' . PHP_EOL . 'trait Test' . PHP_EOL . '{' . PHP_EOL . '' . PHP_EOL . ' public function method1()' . PHP_EOL . ' {' . PHP_EOL . ' //TODO: implements the method1 method' . PHP_EOL . ' }' . PHP_EOL . '}' . PHP_EOL; $this->assertEquals($expected, $code->toString()); }