Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita954fea

Browse files
committed
minor#16155 Added more tests for PropertyAccess (pierredup)
This PR was merged into the 2.7 branch.Discussion----------Added more tests for PropertyAccess| Q | A| ------------- | ---| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets || License | MIT| Doc PR |This is a follow up for [16090#issuecomment-145183635](#16090 (comment))Commits-------378db75 Added more tests for PropertyAccess
2 parents481f39d +378db75 commita954fea

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

‎src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespaceSymfony\Component\PropertyAccess\Tests;
1313

14+
useSymfony\Component\PropertyAccess\Exception\NoSuchIndexException;
1415
useSymfony\Component\PropertyAccess\PropertyAccessor;
1516
useSymfony\Component\PropertyAccess\Tests\Fixtures\TestClass;
1617
useSymfony\Component\PropertyAccess\Tests\Fixtures\TestClassMagicCall;
@@ -139,6 +140,20 @@ public function testGetValueNotModifyObject()
139140
$this->assertSame(array('Bernhard'),$object->firstName);
140141
}
141142

143+
publicfunctiontestGetValueNotModifyObjectException()
144+
{
145+
$propertyAccessor =newPropertyAccessor(false,true);
146+
$object =new \stdClass();
147+
$object->firstName =array('Bernhard');
148+
149+
try {
150+
$propertyAccessor->getValue($object,'firstName[1]');
151+
}catch (NoSuchIndexException$e) {
152+
}
153+
154+
$this->assertSame(array('Bernhard'),$object->firstName);
155+
}
156+
142157
/**
143158
* @expectedException \Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException
144159
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp