@@ 66-81 (lines=16) @@ | ||
63 | /** |
|
64 | * Test metadata methods. |
|
65 | */ |
|
66 | public function testMetadata() |
|
67 | { |
|
68 | $this |
|
69 | ->given($propertyMetadata = $this->createMethodMetadata(User::class, 'id')) |
|
70 | ->when($propertyMetadata->addMetadata('async', true)) |
|
71 | ->and($propertyMetadata->addMetadata('methodName', 'getId')) |
|
72 | ->then() |
|
73 | ->array($propertyMetadata->metadata()) |
|
74 | ->hasKey('async') |
|
75 | ->hasKey('methodName') |
|
76 | ->boolean($propertyMetadata->getMetadata('async')) |
|
77 | ->isTrue() |
|
78 | ->string($propertyMetadata->getMetadata('methodName')) |
|
79 | ->isEqualTo('getId') |
|
80 | ; |
|
81 | } |
|
82 | ||
83 | /** |
|
84 | * Test Reflection method. |
@@ 66-81 (lines=16) @@ | ||
63 | /** |
|
64 | * Test metadata methods. |
|
65 | */ |
|
66 | public function testMetadata() |
|
67 | { |
|
68 | $this |
|
69 | ->given($propertyMetadata = $this->createPropertyMetadata(User::class, 'id')) |
|
70 | ->when($propertyMetadata->addMetadata('identifier', true)) |
|
71 | ->and($propertyMetadata->addMetadata('fieldName', '_id')) |
|
72 | ->then() |
|
73 | ->array($propertyMetadata->metadata()) |
|
74 | ->hasKey('identifier') |
|
75 | ->hasKey('fieldName') |
|
76 | ->boolean($propertyMetadata->getMetadata('identifier')) |
|
77 | ->isTrue() |
|
78 | ->string($propertyMetadata->getMetadata('fieldName')) |
|
79 | ->isEqualTo('_id') |
|
80 | ; |
|
81 | } |
|
82 | ||
83 | /** |
|
84 | * Test Reflection method. |
@@ 112-128 (lines=17) @@ | ||
109 | /** |
|
110 | * Test metadata methods. |
|
111 | */ |
|
112 | public function testMetadata() |
|
113 | { |
|
114 | $this |
|
115 | ->given($className = User::class) |
|
116 | ->and($classMetadata = $this->createClassMetadata($className)) |
|
117 | ->and($classMetadata->addMetadata('collection', 'some_collection_name')) |
|
118 | ->and($classMetadata->addMetadata('embedded', false)) |
|
119 | ->then() |
|
120 | ->array($classMetadata->metadata()) |
|
121 | ->hasKey('collection') |
|
122 | ->hasKey('embedded') |
|
123 | ->boolean($classMetadata->getMetadata('embedded')) |
|
124 | ->isFalse() |
|
125 | ->string($classMetadata->getMetadata('collection')) |
|
126 | ->isEqualTo('some_collection_name') |
|
127 | ; |
|
128 | } |
|
129 | ||
130 | /** |
|
131 | * Test merge method. |