@@ -43,6 +43,28 @@ public function getAxes()
43
43
}
44
44
}
45
45
46
+ class PropertyAccessorCollectionTest_CarOnlyAdder
47
+ {
48
+ public function addAxis ($ axis )
49
+ {
50
+ }
51
+
52
+ public function getAxes ()
53
+ {
54
+ }
55
+ }
56
+
57
+ class PropertyAccessorCollectionTest_CarOnlyRemover
58
+ {
59
+ public function removeAxis ($ axis )
60
+ {
61
+ }
62
+
63
+ public function getAxes ()
64
+ {
65
+ }
66
+ }
67
+
46
68
class PropertyAccessorCollectionTest_CarNoAdderAndRemover
47
69
{
48
70
public function getAxes ()
@@ -143,25 +165,25 @@ public function testSetValueFailsIfNoAdderNorRemoverFound()
143
165
144
166
public function testIsWritableReturnsTrueIfAdderAndRemoverExists ()
145
167
{
146
- $ car = $ this -> getMockBuilder ( __CLASS__ . ' _Car ' )-> getMock ();
168
+ $ car = new PropertyAccessorCollectionTest_Car ();
147
169
$ this ->assertTrue ($ this ->propertyAccessor ->isWritable ($ car , 'axes ' ));
148
170
}
149
171
150
172
public function testIsWritableReturnsFalseIfOnlyAdderExists ()
151
173
{
152
- $ car = $ this -> getMockBuilder ( __CLASS__ . ' _CarOnlyAdder ' )-> getMock ();
174
+ $ car = new PropertyAccessorCollectionTest_CarOnlyAdder ();
153
175
$ this ->assertFalse ($ this ->propertyAccessor ->isWritable ($ car , 'axes ' ));
154
176
}
155
177
156
178
public function testIsWritableReturnsFalseIfOnlyRemoverExists ()
157
179
{
158
- $ car = $ this -> getMockBuilder ( __CLASS__ . ' _CarOnlyRemover ' )-> getMock ();
180
+ $ car = new PropertyAccessorCollectionTest_CarOnlyRemover ();
159
181
$ this ->assertFalse ($ this ->propertyAccessor ->isWritable ($ car , 'axes ' ));
160
182
}
161
183
162
184
public function testIsWritableReturnsFalseIfNoAdderNorRemoverExists ()
163
185
{
164
- $ car = $ this -> getMockBuilder ( __CLASS__ . ' _CarNoAdderAndRemover ' )-> getMock ();
186
+ $ car = new PropertyAccessorCollectionTest_CarNoAdderAndRemover ();
165
187
$ this ->assertFalse ($ this ->propertyAccessor ->isWritable ($ car , 'axes ' ));
166
188
}
167
189
@@ -171,7 +193,7 @@ public function testIsWritableReturnsFalseIfNoAdderNorRemoverExists()
171
193
*/
172
194
public function testSetValueFailsIfAdderAndRemoverExistButValueIsNotTraversable ()
173
195
{
174
- $ car = $ this -> getMockBuilder ( __CLASS__ . ' _Car ' )-> getMock ();
196
+ $ car = new PropertyAccessorCollectionTest_Car ();
175
197
176
198
$ this ->propertyAccessor ->setValue ($ car , 'axes ' , 'Not an array or Traversable ' );
177
199
}
0 commit comments