@@ 68-85 (lines=18) @@ | ||
65 | /** |
|
66 | * Test methodMetadata methods. |
|
67 | */ |
|
68 | public function testMethodMetadata() |
|
69 | { |
|
70 | $this |
|
71 | ->given($className = User::class) |
|
72 | ->and($methodMetadata = new MethodMetadata($className, 'username')) |
|
73 | ->when($classMetadata = $this->createClassMetadata($className)) |
|
74 | ->then() |
|
75 | ->array($classMetadata->methodsMetadata()) |
|
76 | ->isEmpty() |
|
77 | ->and() |
|
78 | ->when($classMetadata->addMethodMetadata($methodMetadata)) |
|
79 | ->then() |
|
80 | ->array($classMetadata->methodsMetadata()) |
|
81 | ->hasKey('username') |
|
82 | ->object($classMetadata->methodMetadata('username')) |
|
83 | ->isEqualTo($methodMetadata) |
|
84 | ; |
|
85 | } |
|
86 | ||
87 | /** |
|
88 | * Test propertyMetadata methods. |
|
@@ 90-107 (lines=18) @@ | ||
87 | /** |
|
88 | * Test propertyMetadata methods. |
|
89 | */ |
|
90 | public function testPropertyMetadata() |
|
91 | { |
|
92 | $this |
|
93 | ->given($className = User::class) |
|
94 | ->and($propertyMetadata = new PropertyMetadata($className, 'username')) |
|
95 | ->when($classMetadata = $this->createClassMetadata($className)) |
|
96 | ->then() |
|
97 | ->array($classMetadata->propertiesMetadata()) |
|
98 | ->isEmpty() |
|
99 | ->and() |
|
100 | ->when($classMetadata->addPropertyMetadata($propertyMetadata)) |
|
101 | ->then() |
|
102 | ->array($classMetadata->propertiesMetadata()) |
|
103 | ->hasKey('username') |
|
104 | ->object($classMetadata->propertyMetadata('username')) |
|
105 | ->isEqualTo($propertyMetadata) |
|
106 | ; |
|
107 | } |
|
108 | ||
109 | /** |
|
110 | * Test metadata methods. |