createEnumCaseBuilder('TEST') ->setDocComment('/** Test */') ->getNode(); $this->assertEquals( new Stmt\EnumCase( "TEST", null, [ 'comments' => [new Comment\Doc('/** Test */')] ] ), $node ); } public function testAddAttribute() { $attribute = new Attribute( new Name('Attr'), [new Arg(new LNumber(1), false, false, [], new Identifier('name'))] ); $attributeGroup = new AttributeGroup([$attribute]); $node = $this->createEnumCaseBuilder('ATTR_GROUP') ->addAttribute($attributeGroup) ->getNode(); $this->assertEquals( new Stmt\EnumCase( "ATTR_GROUP", null, [], [$attributeGroup] ), $node ); } /** * @dataProvider provideTestDefaultValues */ public function testValues($value, $expectedValueNode) { $node = $this->createEnumCaseBuilder('TEST') ->setValue($value) ->getNode() ; $this->assertEquals($expectedValueNode, $node->expr); } public function provideTestDefaultValues() { return [ [ 31415, new Scalar\LNumber(31415) ], [ 'Hallo World', new Scalar\String_('Hallo World') ], ]; } }