Update NoSuchPropertyException message for writeProperty

This commit is contained in:
Thomas Perez 2017-08-28 15:57:41 +02:00
parent ec7a2b14ca
commit 7855748c78
2 changed files with 2 additions and 2 deletions

View File

@ -649,7 +649,7 @@ class PropertyAccessor implements PropertyAccessorInterface
} elseif (self::ACCESS_TYPE_MAGIC === $access[self::ACCESS_TYPE]) {
$object->{$access[self::ACCESS_NAME]}($value);
} elseif (self::ACCESS_TYPE_NOT_FOUND === $access[self::ACCESS_TYPE]) {
throw new NoSuchPropertyException(sprintf('Could not determine access type for property "%s".', $property));
throw new NoSuchPropertyException(sprintf('Could not determine access type for property "%s" in class "%s".', $property, get_class($object)));
} else {
throw new NoSuchPropertyException($access[self::ACCESS_NAME]);
}

View File

@ -148,7 +148,7 @@ abstract class PropertyAccessorCollectionTest extends PropertyAccessorArrayAcces
/**
* @expectedException \Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException
* @expectedExceptionMessage Could not determine access type for property "axes".
* @expectedExceptionMessageRegExp /Could not determine access type for property "axes" in class "Mock_PropertyAccessorCollectionTest_CarNoAdderAndRemover_[^"]*"./
*/
public function testSetValueFailsIfNoAdderNorRemoverFound()
{