@@ -41,6 +41,7 @@ public function testGetProperties()
41
41
'B ' ,
42
42
'Guid ' ,
43
43
'g ' ,
44
+ 'emptyVar ' ,
44
45
'foo ' ,
45
46
'foo2 ' ,
46
47
'foo3 ' ,
@@ -122,37 +123,63 @@ public function php71TypesProvider()
122
123
);
123
124
}
124
125
125
- public function testIsReadable ()
126
+ /**
127
+ * @dataProvider getReadableProperties
128
+ */
129
+ public function testIsReadable ($ property , $ expected )
130
+ {
131
+ $ this ->assertSame (
132
+ $ expected ,
133
+ $ this ->extractor ->isReadable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , $ property , array ())
134
+ );
135
+ }
136
+
137
+ public function getReadableProperties ()
138
+ {
139
+ return array (
140
+ array ('bar ' , false ),
141
+ array ('baz ' , false ),
142
+ array ('parent ' , true ),
143
+ array ('a ' , true ),
144
+ array ('b ' , false ),
145
+ array ('c ' , true ),
146
+ array ('d ' , true ),
147
+ array ('e ' , false ),
148
+ array ('f ' , false ),
149
+ array ('Id ' , true ),
150
+ array ('id ' , true ),
151
+ array ('Guid ' , true ),
152
+ array ('guid ' , false ),
153
+ );
154
+ }
155
+
156
+ /**
157
+ * @dataProvider getWritableProperties
158
+ */
159
+ public function testIsWritable ($ property , $ expected )
126
160
{
127
- $ this ->assertFalse ($ this ->extractor ->isReadable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'bar ' , array ()));
128
- $ this ->assertFalse ($ this ->extractor ->isReadable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'baz ' , array ()));
129
- $ this ->assertTrue ($ this ->extractor ->isReadable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'parent ' , array ()));
130
- $ this ->assertTrue ($ this ->extractor ->isReadable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'a ' , array ()));
131
- $ this ->assertFalse ($ this ->extractor ->isReadable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'b ' , array ()));
132
- $ this ->assertTrue ($ this ->extractor ->isReadable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'c ' , array ()));
133
- $ this ->assertTrue ($ this ->extractor ->isReadable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'd ' , array ()));
134
- $ this ->assertFalse ($ this ->extractor ->isReadable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'e ' , array ()));
135
- $ this ->assertFalse ($ this ->extractor ->isReadable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'f ' , array ()));
136
- $ this ->assertTrue ($ this ->extractor ->isReadable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'Id ' , array ()));
137
- $ this ->assertTrue ($ this ->extractor ->isReadable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'id ' , array ()));
138
- $ this ->assertTrue ($ this ->extractor ->isReadable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'Guid ' , array ()));
139
- $ this ->assertFalse ($ this ->extractor ->isReadable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'guid ' , array ()));
161
+ $ this ->assertSame (
162
+ $ expected ,
163
+ $ this ->extractor ->isWritable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , $ property , array ())
164
+ );
140
165
}
141
166
142
- public function testIsWritable ()
167
+ public function getWritableProperties ()
143
168
{
144
- $ this ->assertFalse ($ this ->extractor ->isWritable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'bar ' , array ()));
145
- $ this ->assertFalse ($ this ->extractor ->isWritable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'baz ' , array ()));
146
- $ this ->assertTrue ($ this ->extractor ->isWritable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'parent ' , array ()));
147
- $ this ->assertFalse ($ this ->extractor ->isWritable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'a ' , array ()));
148
- $ this ->assertTrue ($ this ->extractor ->isWritable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'b ' , array ()));
149
- $ this ->assertFalse ($ this ->extractor ->isWritable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'c ' , array ()));
150
- $ this ->assertFalse ($ this ->extractor ->isWritable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'd ' , array ()));
151
- $ this ->assertTrue ($ this ->extractor ->isWritable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'e ' , array ()));
152
- $ this ->assertTrue ($ this ->extractor ->isWritable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'f ' , array ()));
153
- $ this ->assertFalse ($ this ->extractor ->isWritable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'Id ' , array ()));
154
- $ this ->assertTrue ($ this ->extractor ->isWritable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'Guid ' , array ()));
155
- $ this ->assertFalse ($ this ->extractor ->isWritable ('Symfony\Component\PropertyInfo\Tests\Fixtures\Dummy ' , 'guid ' , array ()));
169
+ return array (
170
+ array ('bar ' , false ),
171
+ array ('baz ' , false ),
172
+ array ('parent ' , true ),
173
+ array ('a ' , false ),
174
+ array ('b ' , true ),
175
+ array ('c ' , false ),
176
+ array ('d ' , false ),
177
+ array ('e ' , true ),
178
+ array ('f ' , true ),
179
+ array ('Id ' , false ),
180
+ array ('Guid ' , true ),
181
+ array ('guid ' , false ),
182
+ );
156
183
}
157
184
158
185
public function testSingularize ()
0 commit comments