Skip to content

Commit 7855748

Browse files
committed
Update NoSuchPropertyException message for writeProperty
1 parent ec7a2b1 commit 7855748

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/PropertyAccess/PropertyAccessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ private function writeProperty($zval, $property, $value)
649649
} elseif (self::ACCESS_TYPE_MAGIC === $access[self::ACCESS_TYPE]) {
650650
$object->{$access[self::ACCESS_NAME]}($value);
651651
} elseif (self::ACCESS_TYPE_NOT_FOUND === $access[self::ACCESS_TYPE]) {
652-
throw new NoSuchPropertyException(sprintf('Could not determine access type for property "%s".', $property));
652+
throw new NoSuchPropertyException(sprintf('Could not determine access type for property "%s" in class "%s".', $property, get_class($object)));
653653
} else {
654654
throw new NoSuchPropertyException($access[self::ACCESS_NAME]);
655655
}

src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorCollectionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function testSetValueCallsAdderAndRemoverForNestedCollections()
148148

149149
/**
150150
* @expectedException \Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException
151-
* @expectedExceptionMessage Could not determine access type for property "axes".
151+
* @expectedExceptionMessageRegExp /Could not determine access type for property "axes" in class "Mock_PropertyAccessorCollectionTest_CarNoAdderAndRemover_[^"]*"./
152152
*/
153153
public function testSetValueFailsIfNoAdderNorRemoverFound()
154154
{

0 commit comments

Comments
 (0)