public function testEvaluateClassUsingTrait() { $this->isTraitAvailable(); $code = new PhpClass(); $code->setName('TestTrait')->setDescription('Class description')->setExtends('\\ArrayIterator')->addMethod(new Method())->addProperty(new Property())->addComposition('\\ClassGeneration\\Test\\Provider\\OtherTrait')->addComposition('\\ClassGeneration\\Test\\Provider\\ObjectTrait'); $code->evaluate(); $this->assertTrue(class_exists('\\TestTrait')); $reflection = new \ReflectionClass($code->getFullName()); $this->assertInstanceOf('\\ReflectionMethod', $reflection->getMethod('doSomething')); }