@@ 28-52 (lines=25) @@ | ||
25 | */ |
|
26 | class TestClassMetadataFactory |
|
27 | { |
|
28 | public static function createAttributeClassMetadata() |
|
29 | { |
|
30 | $expected = new ClassMetadata('RonteLtd\JsonApiBundle\Tests\Fixtures\AttributeDummy'); |
|
31 | ||
32 | $fooAttributeAnnotation = new Attribute(); |
|
33 | $fooAttributeAnnotation->setName('a'); |
|
34 | ||
35 | $foo = new AttributeMetadata('foo'); |
|
36 | $foo->setAttribute($fooAttributeAnnotation); |
|
37 | $expected->addAttributeMetadata($foo); |
|
38 | ||
39 | $barAttributeAnnotation = new Attribute(); |
|
40 | ||
41 | $bar = new AttributeMetadata('bar'); |
|
42 | $bar->setAttribute($barAttributeAnnotation); |
|
43 | $expected->addAttributeMetadata($bar); |
|
44 | ||
45 | $fooBar = new AttributeMetadata('fooBar'); |
|
46 | $expected->addAttributeMetadata($fooBar); |
|
47 | ||
48 | // load reflection class so that the comparison passes |
|
49 | $expected->getReflectionClass(); |
|
50 | ||
51 | return $expected; |
|
52 | } |
|
53 | ||
54 | public static function createRelationshipClassMetadata() |
|
55 | { |
|
@@ 54-78 (lines=25) @@ | ||
51 | return $expected; |
|
52 | } |
|
53 | ||
54 | public static function createRelationshipClassMetadata() |
|
55 | { |
|
56 | $expected = new ClassMetadata('RonteLtd\JsonApiBundle\Tests\Fixtures\RelationshipDummy'); |
|
57 | ||
58 | $fooRelationshipAnnotation = new Relationship(); |
|
59 | $fooRelationshipAnnotation->setName('a'); |
|
60 | ||
61 | $foo = new AttributeMetadata('foo'); |
|
62 | $foo->setRelationship($fooRelationshipAnnotation); |
|
63 | $expected->addAttributeMetadata($foo); |
|
64 | ||
65 | $barRelationshipAnnotation = new Relationship(); |
|
66 | ||
67 | $bar = new AttributeMetadata('bar'); |
|
68 | $bar->setRelationship($barRelationshipAnnotation); |
|
69 | $expected->addAttributeMetadata($bar); |
|
70 | ||
71 | $fooBar = new AttributeMetadata('fooBar'); |
|
72 | $expected->addAttributeMetadata($fooBar); |
|
73 | ||
74 | // load reflection class so that the comparison passes |
|
75 | $expected->getReflectionClass(); |
|
76 | ||
77 | return $expected; |
|
78 | } |
|
79 | ||
80 | public static function createObjectNormalizerClassMetadata() |
|
81 | { |