@@ -316,19 +316,12 @@ public function testIsReadableRecognizesMagicCallIfEnabled()
316
316
$ this ->assertTrue ($ this ->propertyAccessor ->isReadable (new TestClassMagicCall ('Bernhard ' ), 'magicCallProperty ' ));
317
317
}
318
318
319
- public function testIsReadableThrowsExceptionIfNotObjectOrArray ()
320
- {
321
- $ this ->assertFalse ($ this ->propertyAccessor ->isReadable ('baz ' , 'foobar ' ));
322
- }
323
-
324
- public function testIsReadableThrowsExceptionIfNull ()
325
- {
326
- $ this ->assertFalse ($ this ->propertyAccessor ->isReadable (null , 'foobar ' ));
327
- }
328
-
329
- public function testIsReadableThrowsExceptionIfEmpty ()
319
+ /**
320
+ * @dataProvider getPathsWithUnexpectedType
321
+ */
322
+ public function testIsReadableReturnsFalseIfNotObjectOrArray ($ objectOrArray , $ path )
330
323
{
331
- $ this ->assertFalse ($ this ->propertyAccessor ->isReadable ('' , ' foobar ' ));
324
+ $ this ->assertFalse ($ this ->propertyAccessor ->isReadable ($ objectOrArray , $ path ));
332
325
}
333
326
334
327
/**
@@ -384,19 +377,12 @@ public function testIsWritableRecognizesMagicCallIfEnabled()
384
377
$ this ->assertTrue ($ this ->propertyAccessor ->isWritable (new TestClassMagicCall ('Bernhard ' ), 'magicCallProperty ' ));
385
378
}
386
379
387
- public function testNotObjectOrArrayIsNotWritable ()
388
- {
389
- $ this ->assertFalse ($ this ->propertyAccessor ->isWritable ('baz ' , 'foobar ' ));
390
- }
391
-
392
- public function testNullIsNotWritable ()
393
- {
394
- $ this ->assertFalse ($ this ->propertyAccessor ->isWritable (null , 'foobar ' ));
395
- }
396
-
397
- public function testEmptyIsNotWritable ()
380
+ /**
381
+ * @dataProvider getPathsWithUnexpectedType
382
+ */
383
+ public function testIsWritableReturnsFalseIfNotObjectOrArray ($ objectOrArray , $ path )
398
384
{
399
- $ this ->assertFalse ($ this ->propertyAccessor ->isWritable ('' , ' foobar ' ));
385
+ $ this ->assertFalse ($ this ->propertyAccessor ->isWritable ($ objectOrArray , $ path ));
400
386
}
401
387
402
388
public function getValidPropertyPaths ()
0 commit comments